var shapes = [];
var addShape = function(name, pointFn, highlightPointFn) {
shapes.push(name);
- opts[name] = {
+ if (!opts['series']) opts['series'] = {};
+ opts.series[name] = {
drawPointCallback: pointFn,
drawHighlightPointCallback: highlightPointFn
};
return ret;
},
{
- Y1: { fillGraph: true }
+ series: {
+ Y1: { fillGraph: true }
+ }
}
);
</script>
{
legend: 'always',
strokeWidth: 2,
- 'parabola': {
- strokePattern: null,
- drawPoints: true,
- pointSize: 4,
- highlightCircleSize: 6
- },
- 'line': {
- strokePattern: Dygraph.DASHED_LINE,
- strokeWidth: 1.0,
- drawPoints: true,
- pointSize: 1.5
- },
- 'another line': {
- strokePattern: [25, 5]
- },
- 'sine wave': {
- strokePattern: Dygraph.DOTTED_LINE,
- strokeWidth: 3,
- highlightCircleSize: 10
- },
- 'sine wave2': {
- strokePattern: Dygraph.DOT_DASH_LINE,
- strokeWidth: 2,
- highlightCircleSize: 3
+ series: {
+ 'parabola': {
+ strokePattern: null,
+ drawPoints: true,
+ pointSize: 4,
+ highlightCircleSize: 6
+ },
+ 'line': {
+ strokePattern: Dygraph.DASHED_LINE,
+ strokeWidth: 1.0,
+ drawPoints: true,
+ pointSize: 1.5
+ },
+ 'another line': {
+ strokePattern: [25, 5]
+ },
+ 'sine wave': {
+ strokePattern: Dygraph.DOTTED_LINE,
+ strokeWidth: 3,
+ highlightCircleSize: 10
+ },
+ 'sine wave2': {
+ strokePattern: Dygraph.DOT_DASH_LINE,
+ strokeWidth: 2,
+ highlightCircleSize: 3
+ }
}
}
);
data,
{
strokeWidth: 2,
- 'parabola': {
- strokeWidth: 0.0,
- drawPoints: true,
- pointSize: 4,
- highlightCircleSize: 6
- },
- 'line': {
- strokeWidth: 1.0,
- drawPoints: true,
- pointSize: 1.5
- },
- 'sine wave': {
- strokeWidth: 3,
- highlightCircleSize: 10
- },
- 'sine wave2': {
- strokePattern: [10, 2, 5, 2],
- strokeWidth: 2,
- highlightCircleSize: 3
+ series: {
+ 'parabola': {
+ strokeWidth: 0.0,
+ drawPoints: true,
+ pointSize: 4,
+ highlightCircleSize: 6
+ },
+ 'line': {
+ strokeWidth: 1.0,
+ drawPoints: true,
+ pointSize: 1.5
+ },
+ 'sine wave': {
+ strokeWidth: 3,
+ highlightCircleSize: 10
+ },
+ 'sine wave2': {
+ strokePattern: [10, 2, 5, 2],
+ strokeWidth: 2,
+ highlightCircleSize: 3
+ }
}
}
);
{
labels: ['Date', 'A', 'B'],
includeZero: true,
- "A": {
- strokeWidth: 2
- },
- "B": {
- plotter: barChartPlotter
+ series: {
+ "A": {
+ strokeWidth: 2
+ },
+ "B": {
+ plotter: barChartPlotter
+ }
}
});
NoisyData(),
{
errorBars: true,
- 'A': {
- plotter: Dygraph.Plotters.errorPlotter
- },
- 'B': {
- plotter: Dygraph.Plotters.linePlotter,
- strokePattern: Dygraph.DASHED_LINE
+ series: {
+ 'A': {
+ plotter: Dygraph.Plotters.errorPlotter
+ },
+ 'B': {
+ plotter: Dygraph.Plotters.linePlotter,
+ strokePattern: Dygraph.DASHED_LINE
+ }
}
});
labels: ["Date","GapSeries1","GapSeries2"],
showRoller: true,
stepPlot: true,
- GapSeries2: { axis: {} }
+ series: {
+ GapSeries2: {
+ axis: 'y2'
+ }
+ }
}
);
</script>
data,
{
labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ],
- 'Y3': {
- axis: {
- }
- },
- 'Y4': {
- axis: 'Y3' // use the same y-axis as series Y3
+ series: {
+ 'Y3': {
+ axis: 'y2'
+ },
+ 'Y4': {
+ axis: 'y2'
+ },
},
axes: {
y2: {
labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ],
width: 640,
height: 350,
- 'Y3': {
- axis: {
- }
- },
- 'Y4': {
- axis: 'Y3' // use the same y-axis as series Y3
+ series: {
+ 'Y3': { axis: 'y2' },
+ 'Y4': { axis: 'y2' }
},
xAxisLabelWidth: 100,
yAxisLabelWidth: 100,