You must be logged in to post your query.
Home › Forums › Chart Support › Define the pitch/step of the chart
Hello,
I would like to know; is it possible to define/modify the pitch/step between all points of my chart (axisX) ? Example: My chart is defined with a 800px width. We’ll see the data from 0px to 800px (all over the chart): the step is defined automatically in order to see all the chart. Is there a way to change that in order to control this step between points ?
Thank you in advance !
Regards.
Second question: The width of the chart is the width of all the chart, is there a way to control the width of the chart with data (from the first point to the last point) only (without titles…) ?
@Emeric,
For your first query, you can set interval.
Regarding the second query, can you kindly provide a pictorial representation so that we can understand your requirements better and help you out?
—- Bivek Singh, Team CanvasJS
Interval isn’t what I need. Here a representation about step/pitch/interval between points: Is it possible to change this value ? At this moment this value is defined automatically based on the number of data: more you have points, less this value is important. In my example we can consider the step is 50px (for example), if I add data, this step will change and will be less than 50px. I would like to control this step in order to say to the chart “whatever the number of data the step will be the same”. Is it possible ? I know maximum exists (https://canvasjs.com/docs/charts/chart-options/axisx/maximum/) it will fix the step by locking the axis, but it’s not exactly what I’m looking for !
Second question: When you define the width of the chart like that: <div id="chartContainer" style="height: 400px; width: 800px;"></div> 800px will be the width of everything and not only the points. Representation:
<div id="chartContainer" style="height: 400px; width: 800px;"></div>
Thank you for your help !
You can achieve the desired width between dataPoint by setting viewportMinimum and viewportMaximum.
For your second query, you can find the pixel co-ordinates of first and last dataPoint using convertValueToPixel. Please, take a look at this jsFiddle.
You must be logged in to reply to this topic. Login/Register