@@ -175,16 +175,20 @@ function getUnifiedXAxisValues(seriesList, sorted) {
175175 return sorted ? sortBy ( result , identity ) : result ;
176176}
177177
178+ const DEFAULT_XAXIS_LABEL_LENGTH = 300 ;
179+
178180function preparePieData ( seriesList , options ) {
179181 const {
180182 cellWidth, cellHeight, xPadding, yPadding, cellsInRow, hasX,
181183 } = calculateDimensions ( seriesList , options ) ;
182184
185+ const colorPalette = ColorPaletteArray . slice ( ) ;
186+ const xAxisLabelLength = parseInt ( options . xAxisLabelLength , 10 ) || DEFAULT_XAXIS_LABEL_LENGTH ;
183187 return map ( seriesList , ( serie , index ) => {
184188 const xPosition = ( index % cellsInRow ) * cellWidth ;
185189 const yPosition = Math . floor ( index / cellsInRow ) * cellHeight ;
186190 const labels = map ( serie . data , ( row , rowIdx ) => {
187- const rowX = hasX ? row . x : `Slice ${ index } ` ;
191+ const rowX = hasX ? row . x . substr ( 0 , xAxisLabelLength ) : `Slice ${ index } ` ;
188192 const rowOpts = options . seriesOptions [ rowX ] ;
189193 if ( rowOpts ) {
190194 colorPalette [ rowIdx ] = rowOpts . color ;
@@ -193,7 +197,7 @@ function preparePieData(seriesList, options) {
193197 } ) ;
194198 return {
195199 values : pluck ( serie . data , 'y' ) ,
196- labels : labels ,
200+ labels,
197201 type : 'pie' ,
198202 hole : 0.4 ,
199203 marker : { colors : ColorPaletteArray } ,
0 commit comments