Hi,
you must add mulitple plots.
Here is small sample that will help you to understand it:
<pre>
require(["dojox/charting/Chart2D",
"dojox/charting/action2d/Tooltip",
"dojox/charting/widget/Legend",
"dojox/charting/action2d/Magnify",
"dojox/charting/themes/ThreeD",
"dojo/ready"
], function(Chart2D, Tooltip, Legend, Magnify, ThreeD, ready) {
ready(function() {
var stacked = [12000, 13000, 14000, 15000, 17000, 12000, 15000, 18000,
13000, 15000, 12000];

var chart1 = new Chart2D("combinedChart");
chart1.setTheme(ThreeD);

chart1.addPlot("linesPlot", {
type: "Lines",
markers: true
});
chart1.addPlot("columnPlot", {
type: "Columns",
markers: true
});
chart1.addPlot("stackedPlot", {
type: "StackedAreas",
markers: true
});

chart1.addAxis("x", {
labels: [{
value: 1,
text: "2030"
}, {
value: 2,
text: "2035"
},
{
value: 3,
text: "2040"
}, {
value: 4,
text: "2045"
},
{
value: 5,
text: "2050"
}, {
value: 6,
text: "2055"
},
{
value: 7,
text: "2060"
}, {
value: 8,
text: "2065"
},
{
value: 9,
text: "2070"
}, {
value: 10,
text: "2075"
},
{
value: 11,
text: "2080"
}]
});

chart1.addAxis("y", {
min: 0,
max: 23000,
vertical: true,
fixLower: "major",
fixUpper: "major"
});

chart1.addSeries("LinesSeries", [5500, 5700, 5900, 6100, 6300, 6500,
6800, 7000, 7200, 15000, 20000], {
plot: "linesPlot"
});
chart1.addSeries("ColumnSeries", [5500, 5700, 5900, 6100, 3000, 2000,
4000, 2000, 1000, 5000, 6000], {
plot: "columnPlot"
});
chart1.addSeries("StackedSeries", stacked, {
plot: "stackedPlot"
});

//display silver grid in the background
Claro.axis.majorTick.color = "silver";
Claro.axis.minorTick.color = "silver";

// at the bottom of our stack we put the grid
// that shows major lines, and horizontal minor lines
chart1.addPlot("grid", {
type: "Grid",
hMinorLines: true,
vMinorLines: true
});

// Create the tooltip
var tip = new Tooltip(chart1, "linesPlot");
var tip = new Tooltip(chart1, "columnPlot");
var tip = new Tooltip(chart1, "stackedPlot");

// Create the magnifier
var mag = new Magnify(chart1, "linesPlot");
var mag = new Magnify(chart1, "columnPlot");
var mag = new Magnify(chart1, "stackedPlot");

chart1.render();
var legend = new Legend({
chart: chart1
}, "combinedChartLegend");
});
});
</pre>


Martin

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/How-to-combine-the-line-chart-and-bar-chart-into-the-same-chart-tp3731579p3732651.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdojo-interest @
categoriesdojo
postedFeb 10, '12 at 9:17a
activeFeb 10, '12 at 9:17a
posts1
users1
websitedojotoolkit.org

1 user in discussion

Martinerko: 1 post

People

Translate

site design / logo © 2022 Grokbase