Axis shows more data than can fit
Closed this issue · 5 comments
I'm using the following settings to create the below attached chart
As can be seen the xaxis has more data than can fit and so looks bad..
A single row of data for chart-{"period":"2014-02-10","planname":"MYPLAY_FREE_PLAN","subscriptiontypecount":12634},
dimensions: {
period: {
type : 'order',
scale: 'period'
},
subscriptiontypecount : { type: 'measure' },
planname : { type: 'category' },
},
guide: {
x: { label: 'Period', "nice": true,
"tickFormat": "day",
"tickPeriod": "day" }, // custom label for X axis
y: { label: 'Subscriptions', tickFormat: 's', nice:false }, // custom label for Y axis
padding: { b: 40, l: 40, t: 10, r: 10 }//, // chart paddings
}
I tried with dimension period: { type : 'measure', scale: 'time' } but did not help
Hm.. In usual case there should be a scroll bar. Have you reset "fitModel" property somewhere in Plot.globalSettings or chart spec settings?
I would appreciate if you make a JSFiddle which demonstrates the issue.
y, I did have fitModel: 'entire-view' in settings, when I removed this , it did show a scroll bar and showed all the values of dates in x axis and it was readable but it would be nice if the dates fitted in the x axis when fitmodel is reset (similar to how the numeric values fit in y axis )
Ok. then try again
"period": { type : 'measure', scale: 'time' }
and remove "tickPeriod" property from the guide.
thanks, it worked.. could you please explain how the two period dimensions differ
The "time" scale defines continues time scale. It accepts any date and find proper position for it.
"xxx": { type : 'measure', scale: 'time' }
While the "period" scale is discrete.
"yyy": { type : 'order', scale: 'period' }
It defines a finite amount of time slots and when accept a date - cast it to a most appropriate one. Taucharts splits original time range to an equal ordered slots according to the "tickPeriod" rule. It can be a days, weeks, months etc.. (see docs http://api.taucharts.com/basic/guide.html#tickperiod)
NOTE: the continuous "time" scale is not compatible with "tickPeriod" parameter. Once the "tickPeriod" is specified - the scale is converted to the discrete one.