Skip to content

Commit

Permalink
Add new chart option 'majorUnit' from Issue #132
Browse files Browse the repository at this point in the history
  • Loading branch information
GitBrent authored and GitBrent committed Aug 11, 2017
1 parent 694300e commit 65ff143
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ slide.addChart({TYPE}, {DATA}, {OPTIONS});
| `catAxisLabelFontFace` | string | | `Arial` | category-axis font face | font name. Ex: `{ titleFontFace:'Arial' }` |
| `catAxisLabelFontSize` | number | points | `18` | category-axis font size | 1-256. Ex: `{ titleFontSize:12 }` |
| `catAxisOrientation` | string | | `minMax` | category-axis orientation | `maxMin` (high->low) or `minMax` (low->high) |
| `majorUnit` | number | float | `1.0` | value-axis tick steps | Float or whole number. Ex: `{ majorUnit:0.2 }` |
| `valAxisLabelColor` | string | | `000000` | value-axis color | hex color code. Ex: `{ valAxisLabelColor:'0088CC' }` |
| `valAxisLabelFontFace` | string | | `Arial` | value-axis font face | font name. Ex: `{ titleFontFace:'Arial' }` |
| `valAxisLabelFontSize` | number | points | `18` | value-axis font size | 1-256. Ex: `{ titleFontSize:12 }` |
Expand Down
6 changes: 3 additions & 3 deletions dist/pptxgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if ( NODEJS ) {
var PptxGenJS = function(){
// CONSTANTS
var APP_VER = "1.8.0-beta";
var APP_REL = "20170807";
var APP_REL = "20170810";
//
var MASTER_OBJECTS = {
'chart': { name:'chart' },
Expand Down Expand Up @@ -1192,8 +1192,7 @@ var PptxGenJS = function(){
strXml += ' <c:crossAx val="2094734552"/>';
strXml += ' <c:crosses val="autoZero"/>';
strXml += ' <c:crossBetween val="'+ ( rel.opts.type == 'area' ? 'midCat' : 'between' ) +'"/>';
//strXml += ' <c:majorUnit val="25"/>'; // NOTE: Not Required. // TODO: Add OPTION?
//strXml += ' <c:minorUnit val="12.5"/>'; // NOTE: Not Required. // TODO: Add OPTION?
if ( rel.opts.majorUnit ) strXml += ' <c:majorUnit val="'+ rel.opts.majorUnit +'"/>';
strXml += '</c:valAx>';
}

Expand Down Expand Up @@ -2873,6 +2872,7 @@ var PptxGenJS = function(){
options.dataLabelFormatCode = ( options.dataLabelFormatCode && typeof options.dataLabelFormatCode === 'string' ? options.dataLabelFormatCode : (options.type == 'pie' ? '0%' : '#,##0') );
//
options.lineSize = ( typeof options.lineSize === 'number' ? options.lineSize : 2 );
options.majorUnit = ( typeof options.majorUnit === 'number' ? options.majorUnit : null );

// STEP 4: Set props
gObjPptx.slides[slideNum].data[slideObjNum] = {};
Expand Down

0 comments on commit 65ff143

Please sign in to comment.