jQuery UI Widgets › Forums › Chart › Share Value Axis for Bar Chart and Line Overlay
Tagged: Angular chart, angular2 chart, bootstrap chart, javascript chart, jquery chart, jqwidgets chart, jqxChart, typescript chart
This topic contains 4 replies, has 2 voices, and was last updated by roblajolla 7 years, 11 months ago.
-
Author
-
Hi,
I am trying to use the same valueAxis for a bar chart and an overlay line chart. However, the line chart is trying to use it’s own valueAxis. It is important to have the bar chart valueAxis be ‘auto’ and the line chart to use exactly the same valueAxis. How is this accomplished?
Thanks,
Rob
var settings = {
title: chart.label,
description: ‘This is description’,
enableAnimations: true,
showLegend: chart.legend.enabled,
padding: { left: 5, top: 5, right: 5, bottom: 5 },
titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },
source: chartDataSet,
xAxis:
{
dataField: ‘lift_ranked_estimate’,
unitInterval: 1,
showGridLines: true
},
colorScheme: ‘scheme01’,
seriesGroups:
[
{
type: ‘column’,
//columnsGapPercent: 25,
seriesGapPercent: 2,
valueAxis:
{
visible: true,
description: ‘Lift’,
axisSize: ‘auto’,
tickMarksColor: ‘#888888’
},
series: [
{ dataField: ‘lift’, displayText: ‘Training Lift’},
{ dataField: ‘cumLift’, displayText: ‘Cum Lift’},
]
},
{
type: ‘line’,
// I don’t want to show this but it shows me that the valueAxis is completely different and based on the values of the dataField ‘average’. If I omit the valueAxis entry, it doesn’t work either.
valueAxis: {
visible: true
},
series: [
{ dataField: ‘average’, displayText: ‘Average’},
]
}
]
};Hello Rob,
Please, take a look at this demo:
http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxchart/javascript_chart_column_series.htm?light
Hope this helps.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comHristo,
Thanks for the quick reply. The example you showed me uses a different valueAxis for the line chart. I need to use the same valueAxis for the column chart and the line chart. I also need to allow the valueAxis to be ‘auto’. The issue is that I need to tell the line chart to use the same valueAxis definition as the column chart but allow the column chart while leaving it ‘auto’. It would be nice to tell the line chart to ‘useSameValueAxis’ as the column chart.
Thanks,
Rob
Hello Rob,
Sorry for my mistake.
I would like to suggest you another demos:
http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxchart/javascript_chart_column_range.htm?light
http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxchart/javascript_chart_logarithmic_axis.htm?lightI am not sure what exactly you mean with “allow the valueAxis to be ‘auto'”.
If you want to add customizations invalueAxis
you could useformatFunction
, please take a look at this forum topic.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comHristo,
Thank you very much – these examples solved my problem. I was specifying the valueAxis for each series group rather than specifying a single valueAxis above the seriesgroups.
Thank you for your great support!
Rob
-
AuthorPosts
You must be logged in to reply to this topic.