Can Dojo MouseIndicator be HTML and not just plain text? - dojo

Ive got some chart code whereas I add a MouseIndicator to a line chart. I want the text on the MouseIndicator to be HTML and I am not sure if this is possible since it is not working. Ive added a labelFunc to return the HTML I want, but it only ever shows up as plain text.
Ive got the code on JSFiddle (and below) so you can try it out.
Any help is appreciated.
require(["dojox/charting/Chart",
"dojox/charting/action2d/Magnify",
"dojox/charting/action2d/Highlight",
"dojox/charting/action2d/Tooltip",
"dojox/charting/widget/Legend",
"dojox/charting/themes/PlotKit/green",
"dojox/charting/plot2d/StackedLines",
"dojox/charting/action2d/MouseIndicator",
"dojox/charting/axis2d/Default",
"dojo/ready"
], function(Chart, Magnify, Highlight, Tooltip, Legend, theme_green, _lines, MouseIndicator, _axis, ready) {
// wrapped in domready event
ready(function() {
// create a chart with placeholder div#charty
var chart2 = new Chart("chart");
chart2.setTheme(theme_green);
chart2.addPlot("default", {
type: "StackedLines",
markers: true,
// create round dots on plot-points
tension: 3,
// curve slightly
shadows: { // add shadow
dx: 2,
dy: 2,
dw: 2
}
});
chart2.addAxis("x", {
min: 0,
majorTick: {
stroke: "black",
length: 3
},
minorTick: {
stroke: "gray",
length: 3
}
});
chart2.addAxis("y", {
vertical: true,
min: 0,
max: 6,
majorTick: {
stroke: "black",
length: 3
},
minorTick: {
stroke: "gray",
length: 3
}
});
// each point, added to a series.
// note the first entry in Series A which has the
// customizable object notation
// Hover mouse over lower left point (first red square"
chart2.addSeries("Series A", [{
x: 0.5,
y: 3.5,
tooltip: "Custom data"}
, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6], {
stroke: {
color: "red",
width: 2
},
fill: "lightpink",
marker: "m-3,-3 l0,6 6,0 0,-6 z"
});
chart2.addSeries("Series B", [1, 1.6, 1.3, 1.4, 1.1, 1.5, 1.1], {
stroke: {
color: "blue",
width: 2
},
fill: "lightblue",
marker: "m-3,0 c0,-4 6,-4 6,0 m-6,0 c0,4 6,4 6,0"
});
chart2.addSeries("Series C", [1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6], {
stroke: {
color: "green",
width: 2
},
fill: "lightgreen",
marker: "m0,-3 l3,3 -3,3 -3,-3 z"
});
var anim2a = new Magnify(chart2, "default", {
scale: 3
});
var anim2b = new Highlight(chart2, "default");
var anim2c = new Tooltip(chart2, "default");
var legend2 = new Legend({
chart: chart2
}, "legend2");
new dojox.charting.action2d.MouseIndicator(chart2, "default", {
series : "Series A",
mouseOver: true,
labelFunc: function(v, v2){
return "<div>fred</br></br>betty</div>";
},
fillFunc: function(v){
return '#fcfcfc';
},
fontColor:'black',
stroke: {width: 2, color: 'purple'},
lineStroke: {width: 2, color: 'green'},
dualIndicator: true
});
chart2.render();
});
});

By default only plain text is rendered because the rendering is either done by SVG or Canvas (or VML for old IEs). However you should be able to customize this to render some HTML.
The way to proceed is to tell the data indicator to not render the labels itself (labels: false) and do it yourself in when a change event occurs. Something like the following (here using a dijit/Tooltip but you can use any other way to render HTML):
require(["dojo/ready", "dojo/on", "dojox/charting/Chart", "dojox/charting/axis2d/Default", "dojox/charting/plot2d/Lines",
"dojox/charting/action2d/MouseIndicator", "dijit/Tooltip", "dijit/place"],
function(ready, on, Chart, Default, Lines, MouseIndicator, Tooltip, place){
ready(function(){
var chart = new Chart("chart", { margins : {l :20, t:10, b:10, r: 50}});
chart.addAxis("x", {fixLower: "minor", natural: true, stroke: "gray",
majorTick: {color: "red", length: 4}, minorTick: {color: "blue", length: 2}});
chart.addAxis("y", {vertical: true, min: 0, max: 100, majorTickStep: 10, minorTickStep: 5, stroke: "gray",
majorTick: {stroke: "black", length: 4}, minorTick: {stroke: "gray", length: 2}});
chart.addPlot("default", {type: Lines, markers: false});
chart.addSeries("Series A", [
{ x: 1, y: 8},{ x: 2, y: 7},{ x: 3, y: 3},{ x: 4, y: 2},{ x: 5, y: 5},{ x: 6, y: 7},{ x: 7, y: 9},{ x: 8, y: 10},{ x: 9, y: 2},{ x: 10, y: 10},
{ x: 15, y: 14},{ x: 16, y: 16},{ x: 17, y: 18},{ x: 18, y: 13},{ x: 19, y: 16},{ x: 20, y: 15},{ x: 21, y: 20},{ x: 22, y: 19},{ x: 23, y: 15},{ x: 24, y: 12},
{ x: 25, y: 24},{ x: 26, y: 20},{ x: 27, y: 20},{ x: 28, y: 26},{ x: 29, y: 28},{ x: 30, y: 26},{ x: 31, y: 28},{ x: 32, y: 29},{ x: 33, y: 24},{ x: 34, y: 29},
{ x: 35, y: 31},{ x: 36, y: 35},{ x: 37, y: 37},{ x: 38, y: 31},{ x: 39, y: 35},{ x: 40, y: 37},{ x: 41, y: 37},{ x: 42, y: 36},{ x: 43, y: 31},{ x: 44, y: 30},
{ x: 45, y: 50},{ x: 46, y: 49},{ x: 47, y: 42},{ x: 48, y: 46},{ x: 49, y: 44},{ x: 50, y: 40},{ x: 51, y: 47},{ x: 52, y: 43},{ x: 53, y: 48},{ x: 54, y: 47},
{ x: 55, y: 51},{ x: 56, y: 52},{ x: 57, y: 52},{ x: 58, y: 51},{ x: 59, y: 54},{ x: 60, y: 57},{ x: 61, y: 58},{ x: 62, y: 50},{ x: 63, y: 54},{ x: 64, y: 51},
{ x: 65, y: 62},{ x: 66, y: 68},{ x: 67, y: 67},{ x: 68, y: 62},{ x: 69, y: 62},{ x: 70, y: 65},{ x: 71, y: 61},{ x: 72, y: 66},{ x: 73, y: 65},{ x: 74, y: 62},
{ x: 75, y: 74},{ x: 76, y: 78},{ x: 77, y: 78},{ x: 78, y: 77},{ x: 79, y: 74},{ x: 80, y: 74},{ x: 81, y: 72},{ x: 82, y: 74},{ x: 83, y: 70},{ x: 84, y: 78},
{ x: 85, y: 84},{ x: 86, y: 83},{ x: 87, y: 85},{ x: 88, y: 86},{ x: 89, y: 86},{ x: 90, y: 89},{ x: 91, y: 89},{ x: 92, y: 85},{ x: 93, y: 86},{ x: 94, y: 86},
{ x: 95, y: 98},{ x: 96, y: 97},{ x: 97, y: 93},{ x: 98, y: 91},{ x: 99, y: 92},{ x: 100, y: 92}
]);
var i = MouseIndicator(chart, "default", { series: "Series A", labels: false });
var tooltip = new Tooltip();
on(i, "Change", function(evt){
if(evt.label){
var around = chart.getPlot("default").toPage({ x: evt.start.x, y: maxVertical });
around.w = 1;
around.h = 1;
tooltip.label = "<h1>value:</h1><h2>" + evt.start.y + "</h2>";
tooltip.position = ["above-centered"];
if (!shown) {
shown = true;
tooltip.open(around);
} else {
Tooltip._masterTT.containerNode.innerHTML = tooltip.label;
place.around(Tooltip._masterTT.domNode, around, ["above-centered"]);
}
} else {
// hide
tooltip.close();
shown = false;
}
});
chart.render();
var maxVertical = chart.getAxis("y").getScaler().bounds.to;
var shown = false;
})
});

Related

Chart.js Radial chart with arrow using Vue.js

Hello everyone I am a newbie in using chart.js package, is there a way I can create is king of chart?
Yes, it is possible.
There might be already a plugin, that can achieve this (but I don't know any, but I didn't really look), so you could look for one,
Or you could simply write your own plugin, with a few lines of code
Here a demo, how I would do this, with an inline plugin:
(three charts with 3 different percentages)
var arrowPlugin = {
id: 'arrowPlugin',
afterDraw: (chart, args, options) => {
const { ctx } = chart;
let midX = chart.width / 2;
let midY = chart.height;
let arrowLength = chart.height / 2;
let text = `${options.value * 100}%`;
let textSize = ctx.measureText(text);
ctx.save();
ctx.save();
ctx.translate(midX, midY);
ctx.rotate( (Math.PI * options.value) - Math.PI /2);
ctx.strokeStyle = options.arrowColor;
ctx.fillStyle = options.arrowColor;
ctx.lineCap = 'butt';
ctx.lineWidth = 3;
ctx.beginPath();
ctx.moveTo(0, - arrowLength * 3 / 4 + 3)
ctx.lineTo(0, - arrowLength * 6 / 4);
ctx.stroke();
ctx.beginPath();
ctx.moveTo(0, - arrowLength * 6 / 4 - 4)
ctx.lineTo(5, - arrowLength * 6 / 4 + 10)
ctx.lineTo(-5, - arrowLength * 6 / 4 + 10)
ctx.closePath();
ctx.fill()
ctx.fillStyle = options.triangleColor;
ctx.beginPath();
ctx.moveTo(0, -midY + 25)
ctx.lineTo(-10, -midY + 10)
ctx.lineTo(10, -midY + 10)
ctx.closePath()
ctx.fill();
ctx.restore();
ctx.fillStyle = options.textColor;
ctx.font = "50px Arial";
ctx.fillText(text, midX - textSize.width * 1.5, midY - 25);
ctx.restore();
},
defaults: {
// set here the percentage
value:.50,
arrowColor: 'black',
textColor: 'black',
triangleColor: 'black'
}
}
var options1 = {
type: 'doughnut',
data: {
datasets: [{
data: [20, 50, 30],
backgroundColor: [
'rgba(231, 76, 60, 1)',
'rgba(255, 164, 46, 1)',
'rgba(46, 204, 113, 1)'
],
borderColor: [
'rgba(255, 255, 255 ,1)',
'rgba(255, 255, 255 ,1)',
'rgba(255, 255, 255 ,1)'
],
borderWidth: 0
}]},
options: {
cutout: 33,
rotation: -90,
circumference: 180,
maintainAspectRatio: false,
legend: { display: false },
plugins:{
tooltip: { enabled: false },
}
},
plugins:[arrowPlugin]
}
var options2 = {
type: 'doughnut',
data: {
datasets: [{
data: [20, 50, 30],
backgroundColor: [
'rgba(231, 76, 60, 1)',
'rgba(255, 164, 46, 1)',
'rgba(46, 204, 113, 1)'
],
borderColor: [
'rgba(255, 255, 255 ,1)',
'rgba(255, 255, 255 ,1)',
'rgba(255, 255, 255 ,1)'
],
borderWidth: 0
}]},
options: {
cutout: 33,
rotation: -90,
circumference: 180,
maintainAspectRatio: false,
legend: { display: false },
plugins:{
tooltip: { enabled: false },
// override default percentage
arrowPlugin: { value: .20 }
}
},
plugins:[arrowPlugin]
}
var options3 = {
type: 'doughnut',
data: {
datasets: [{
data: [20, 50, 30],
backgroundColor: [
'rgba(231, 76, 60, 1)',
'rgba(255, 164, 46, 1)',
'rgba(46, 204, 113, 1)'
],
borderColor: [
'rgba(255, 255, 255 ,1)',
'rgba(255, 255, 255 ,1)',
'rgba(255, 255, 255 ,1)'
],
borderWidth: 0
}]},
options: {
cutout: 33,
rotation: -90,
circumference: 180,
maintainAspectRatio: false,
legend: { display: false },
plugins:{
tooltip: { enabled: false },
// override default percentage
arrowPlugin: { value: .70 }
}
},
plugins:[arrowPlugin]
}
const chart1 = document.getElementById('chart1')
new Chart(chart1, options1);
const chart2 = document.getElementById('chart2')
new Chart(chart2, options2);
const chart3 = document.getElementById('chart3')
new Chart(chart3, options3);
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<div style="width:500px;height:184px">
<canvas id="chart1" width="500" height="184"></canvas>
<canvas id="chart2" width="500" height="184"></canvas>
<canvas id="chart3" width="500" height="184"></canvas>
<div>
the percentage is currently set in the inline plugin-options, default value is set to .5 = 50% (valid range 0 - 1 = 0% - 100%).

Victory Chart clickable bar

I'm building a graph and I want to be able to click a bar to show some info when clicked, but even though I inserted all information set in the Victory Chart page is not working, could anyone help me, here is the code
<VictoryStack colorScale={['#533AED']}>
{myWeekDataset &&
myWeekDataset.map((data, i) => {
console.log(data)
return (
<VictoryBar
style={{data: {strokeWidth: 0}}}
cornerRadius={{
top: 10,
bottom: 10,
}}
events={
[
{
target: "data",
eventHandlers: {
onClick: () => {
return [{
target: "data",
mutation: (props) => {
console.log('>>>>CLICKED', props)
}
}]
},
},
},
]
}
data={data}
key={i}
/>
);
})}
</VictoryStack>
this is the data
const myWeekDataset = [
[
{x: moment().subtract(7, 'days').format('ddd'), y: 8},
{x: moment().subtract(6, 'days').format('ddd'), y: 10},
{x: moment().subtract(5, 'days').format('ddd'), y: 6},
{x: moment().subtract(4, 'days').format('ddd'), y: 7},
{x: moment().subtract(3, 'days').format('ddd'), y: 4},
{x: moment().subtract(2, 'days').format('ddd'), y: 8},
{x: moment().subtract(1, 'days').format('ddd'), y: 9},
],
];
What am I doing wrong?

Trying to update high chart data

I am trying to update the data series on the update button by providing new series. As the result, new series will be a plotting along with the old series.
And After plotting the new series, the values on are X-axis is clear up. Here I Am attaching the code snippet please have look.
Initial State config:
this.state = {
chartOptions: {
credits: {
enabled: false,
},
chart: {
type: 'spline',
},
title: {
text: 'Chart',
},
plotOptions: {
series: {
shadow: false,
marker: {
enabled: false,
},
},
},
xAxis: {
gridLineWidth: 1,
type: 'datetime',
lineColor: '#999',
lineWidth: 1,
title: {
text: 'Time',
style: {
color: '#000',
},
},
},
yAxis: [
{
title: {
text: 'Value',
},
gridLineWidth: 1,
lineWidth: 1,
opposite: true,
plotLines: [
{
color: '#55c2ea',
width: 2,
value: props.data[0][1], // Need to set this probably as a var.
label: {
text: props.data[0][1],
textAlign: 'left',
verticalAlign: 'middle',
style: {
color: '#55c2ea',
fontSize: 16,
borderWidth: 1,
backgroundColor: '#55c2ea',
borderColor: '#55c2ea',
},
x: 330,
},
},
],
accessibility: {
enabled: true,
},
opposite: true,
},
],
time: {
useUTC: false
},
series: [
{
showInLegend: false,
color: '#FF0000',
data: props.data.slice(0, props.tradingInterval),
},
],
}
};
Update Function:
updateSeries = () => {
this.setState({ chartOptions: {
series: [
{
showInLegend: false,
color: '#FF0000',
data: this.props.data.slice(0, 15),}
]
} })
}
Graph Render code:
render() {
return (
<View style={styles.container}>
<HighchartsReactNative
styles={styles.chart}
options={this.state.chartOptions}
/>
<Button
title="Refresh"
onPress={this.updateSeries.bind(this)}/>
</View>
);
}
After updating graph looks like
Class Component Code: https://gist.github.com/cupatil/da00b0ab0866e3a4f9306f0425e92582
Also tried this code using a functional component.
Using Functional Component Code: https://gist.github.com/cupatil/2fc1862f64f3a511158ced3c6b64d215
But the same thing happens series changed but not able to plot the graph property as per the image. Also, X-Axis data not calculated properly.
Sample Series data that I am using:
[ { x: 1607883000000, y: 1.6093 },{ x: 1607882940000, y: 1.6094 },{ x: 1607882880000, y: 1.6093 },{ x: 1607882820000, y: 1.6094 },{ x: 1607882760000, y: 1.6094 },{ x: 1607882700000, y: 1.6094 },{ x: 1607882640000, y: 1.6095 },{ x: 1607882580000, y: 1.6094 },{ x: 1607882520000, y: 1.6095 },{ x: 1607882460000, y: 1.6093 },{ x: 1607882400000, y: 1.6095 },{ x: 1607882340000, y: 1.6095 },{ x: 1607882280000, y: 1.6088 },{ x: 1607882220000, y: 1.6096 },{ x: 1607882160000, y: 1.6095 },{ x: 1607882100000, y: 1.6096 },{ x: 1607882040000, y: 1.6096 },{ x: 1607881980000, y: 1.6096 },{ x: 1607881920000, y: 1.6097 },{ x: 1607881860000, y: 1.6097 },{ x: 1607881800000, y: 1.6099 },{ x: 1607881740000, y: 1.6101 },{ x: 1607881680000, y: 1.61 },{ x: 1607881620000, y: 1.61 },{ x: 1607881560000, y: 1.6099 },{ x: 1607881500000, y: 1.6099 },{ x: 1607881440000, y: 1.6099 },{ x: 1607881380000, y: 1.6098 },{ x: 1607881320000, y: 1.6099 },{ x: 1607881260000, y: 1.6098 },{ x: 1607881200000, y: 1.6098 },{ x: 1607881140000, y: 1.6098 },{ x: 1607881080000, y: 1.6099 },{ x: 1607881020000, y: 1.6098 },{ x: 1607880960000, y: 1.6099 },{ x: 1607880900000, y: 1.6098 },{ x: 1607880840000, y: 1.6098 },{ x: 1607880780000, y: 1.6099 },{ x: 1607880720000, y: 1.6098 },{ x: 1607880660000, y: 1.6096 },{ x: 1607880600000, y: 1.6097 },{ x: 1607880540000, y: 1.61 },{ x: 1607880480000, y: 1.6099 },{ x: 1607880420000, y: 1.6101 },{ x: 1607880360000, y: 1.61 },{ x: 1607880300000, y: 1.6101 },{ x: 1607880240000, y: 1.61 },{ x: 1607880180000, y: 1.6101 },{ x: 1607880120000, y: 1.6101 },{ x: 1607880060000, y: 1.61 },{ x: 1607880000000, y: 1.6099 },{ x: 1607879940000, y: 1.6099 },{ x: 1607879880000, y: 1.6098 },{ x: 1607879820000, y: 1.61 },{ x: 1607879760000, y: 1.6097 },{ x: 1607879700000, y: 1.6098 },{ x: 1607879640000, y: 1.6096 },{ x: 1607879580000, y: 1.6096 },{ x: 1607879520000, y: 1.6097 },{ x: 1607879460000, y: 1.6096 },{ x: 1607879400000, y: 1.6095 } ]
All right, I was doing it the other way around, and that's why I was not able to reproduce the described error. Well, so now I see the problem, but as I thought, it's caused by passing not sorted (x ascending order) data, what you can notice after opening the browsers console, and see the Highcharts #15 error.
In order to make it work correctly, you need to always make sure that you're passing the data, which is sorted in ascending order (point x values are increasing along with the array element index).
So, to sum up, sort the array:
[
// data here
].sort((a, b) => a.x - b.x)
then change the the way you prepare (slice) the initial data:
data.slice(data.length - 1 - 15, data.length - 1)
and now it should work as expected.
Live examples:
Without React: https://jsfiddle.net/BlackLabel/37cdryg9/
With React: https://codesandbox.io/s/highcharts-react-demo-forked-q3whu

ScrollMagic - always animate first item first

Is there a way to ensure that the first item that appears always scrolls in first - using this code? At the moment it fires depending on the order of the elements. I am asking because the order of the elements changes throughout the site - I would rather not create a new scene for every different scenario. Someone might see a clever way of doing this. Thanks for any help in advance.
$('.data-scrollIn').each(function(index, elem) {
// Init ScrollMagic Controller
var controller = new ScrollMagic.Controller();
// Create Animations
h2 = $(elem).find('h2');
h3 = $(elem).find('h3');
btn = $(elem).find('.btn');
p = $(elem).find('p');
img = $(elem).find('img');
span = $(elem).find('span.js-fade-order');
var tl = new TimelineMax({
pause: true
});
tl.add("start") // add timeline label
.fromTo(span, 0.6, {
opacity: 0,
y: "40px",
}, {
opacity: 1,
y: "0",
ease: Power0.easeInOut
}, 0.3, "start")
.fromTo(h2, 0.6, {
opacity: 0,
y: "40px",
}, {
opacity: 1,
y: "0",
ease: Power0.easeInOut
}, 0.6, "start")
.fromTo(img, 0.6, {
opacity: 0,
y: "40px",
}, {
opacity: 1,
y: "0",
ease: Power0.easeInOut
}, 0.9, "start")
.fromTo(h3, 0.6, {
opacity: 0,
y: "40px",
}, {
opacity: 1,
y: "0",
ease: Power0.easeInOut
}, 1.2, "start")
.fromTo(p, 0.6, {
opacity: 0,
y: "40px",
}, {
opacity: 1,
y: "0",
ease: Power0.easeInOut
}, 1.5, "start")
.fromTo(btn, 0.6, {
opacity: 0,
y: "40px",
}, {
opacity: 1,
y: "0",
ease: Power0.easeInOut
}, 1.8, "start")
// Create the Scene and trigger when visible
var sceneFade = new ScrollMagic.Scene({
triggerElement: elem,
offset: -100 /* offset the trigger Npx below scene's top */
})
.setTween(tl)
.addTo(controller);
});
$('.data-scrollIn').each(function(index, elem) {
// Init ScrollMagic Controller
var controller = new ScrollMagic.Controller();
// Create Animations
fadeElem = $(elem).find('h2, h3, .btn, p, img, span.js-fade-order ');
var tl = new TimelineMax({
pause: true
});
tl.add("start") // add timeline label
.staggerFromTo(fadeElem, 0.6, {
opacity: 0,
y: "40px",
}, {
opacity: 1,
y: "0",
ease: Power0.easeInOut
}, 0.6, "start")
// Create the Scene and trigger when visible
var sceneFade = new ScrollMagic.Scene({
triggerElement: elem,
offset: -100 /* offset the trigger Npx below scene's top */
})
.setTween(tl)
.addTo(controller);
});

How to change chart series line color in Dojo?

I am now using Dojo to show a line chart. but I don't know how to change the series line color, would anyone help? thx.
var chart1 = new dc.Chart("test1");
chart1.addPlot("default", { type: "Default", lines: true, markers: true, tension: 1 });
chart1.addAxis("x", { majorTick: { stroke: "black", length: 5 }, minorTick: { stroke: "black", length: 1} });
chart1.addAxis("y", { vertical: true, majorTick: { stroke: "black", length: 5 }, minorTick: { stroke: "black", length: 1} });
chart1.addSeries("Series A", [{ x: 0.5, y: 5 }, { x: 1.5, y: 1.5 }, { x: 2, y: 9 }, { x: 5, y: 0.3}]);
chart1.addSeries("Series B", [{ x: 0.3, y: 8 }, { x: 4, y: 6, tooltip: "Custom tooltip" }, { x: 5.5, y: 2}]);
chart1.addSeries("Series C", [{ x: 0.8, y: 6 }, { x: 8, y: 1, tooltip: "Custom tooltip" }, { x: 7, y: 2}]);
chart1.addSeries("Series D", [{ x: 0.1,y: 5}, { x: 2, y: 3, tooltip: "Custom tooltip" }, { x: 4, y: 5}]);
var anim1a = new dc.action2d.Magnify(chart1, "default");
var anim1b = new dc.action2d.Tooltip(chart1, "default");
chart1.render();
for Series A, Series B,Series C,Series D,I want to use my-defined color to show them, anyone can help?
You can probably also provide the color in your series for it to be used by the plot. Something like the following:
chart1.addSeries("Series A",
[{ x: 0.5, y: 5 }, { x: 1.5, y: 1.5 }, { x: 2, y: 9 }, { x: 5, y: 0.3}],
{ stroke: "green" });
You can change the colors by using the setTheme() function while defining your chart.
Must look like :
require(["dojox/charting/Chart", "dojox/charting/themes/Shrooms", "dojox/charting/plot2d/Areas", ...],
function(Chart, Shrooms, Areas, ...){
new Chart(node)
addPlot("default", { type: Areas, tension: "X" })
setTheme(Shrooms)
addSeries("Series A", [1, 2, 0.5, 1.5, 1, 2.8, 0.4])
addSeries("Series B", [2.6, 1.8, 2, 1, 1.4, 0.7, 2])
addSeries("Series C", [6.3, 1.8, 3, 0.5, 4.4, 2.7, 2])
render();
});
In this example the Theme "Shrooms" will be loaded.
Here you can see, what themes are available for Charts:
http://demos.dojotoolkit.org/demos/chartTypes/demo.html
and in the dojo API you can find them under dojox/charting/themes.
Here's a good tutorial how you can define themes by yourself:
http://dojotoolkit.org/documentation/tutorials/1.9/charting/
Regards, Miriam