Home › forums › Using CanvasJS › is there a way to have two charts share 1 y-axis?
This topic contains 5 replies, has 3 voices, and was last updated by xiaosongzou 2 years, 3 months ago.
I have a line chart and a bar chart on my page. i want to use y axis of the line chart as the x axis of the bar chart.
is there a way to do that? please refer to the screenshot for an example
Sorry, as of now Bar chart Cannot be combined with any other chart types except Bar and Stacked Bar charts.
Do you have any suggestion or work around for this?Thanks!
All i want to do is to align the y-axis of two charts. Let me ask some other questions which may help.
1. can we control the width of labels(not max-width)
2. can we remove the gap between bars?
I marked them in the following screenshot
We have just released v1.9.6 Beta with Methods & Properties, which allows you to programmatically access internally calculated values, export chart as image, print chart, etc. Please refer to the release blog for more information.
Please check this jsfiddle.
1) As of now we don’t have width property of label. Using margin you can align the axis of both the chart.
2) For controlling gap between bars you can use dataPointMinWidth.
Also you can check interval,viewportMinimum and viewportMaximum for aligning the labels/grid-lines.
With dataPointMinWidth, how can i remove gap between bars without overlap? Overlapping bars look weird.
You must be logged in to reply to this topic.