From: Dan Vanderkam Date: Wed, 19 Nov 2014 06:22:46 +0000 (-0500) Subject: port over tests X-Git-Tag: v1.1.0~19^2~4 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=27fd63fc0ca45c06318bb47dd8c0f6aa074957b8;p=dygraphs.git port over tests --- diff --git a/tests/custom-circles.html b/tests/custom-circles.html index 0f0ec3c..127ec04 100644 --- a/tests/custom-circles.html +++ b/tests/custom-circles.html @@ -98,7 +98,8 @@ 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 }; diff --git a/tests/fillGraph.html b/tests/fillGraph.html index 0188dc4..2b048df 100644 --- a/tests/fillGraph.html +++ b/tests/fillGraph.html @@ -59,7 +59,9 @@ return ret; }, { - Y1: { fillGraph: true } + series: { + Y1: { fillGraph: true } + } } ); diff --git a/tests/per-series.html b/tests/per-series.html index 84730b1..4f436d6 100644 --- a/tests/per-series.html +++ b/tests/per-series.html @@ -70,30 +70,32 @@ { 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 + } } } ); @@ -102,25 +104,27 @@ 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 + } } } ); diff --git a/tests/plotters.html b/tests/plotters.html index 104ab78..5bbbf15 100644 --- a/tests/plotters.html +++ b/tests/plotters.html @@ -246,11 +246,13 @@ var candleData = "Date,Open,Close,High,Low\n" + { labels: ['Date', 'A', 'B'], includeZero: true, - "A": { - strokeWidth: 2 - }, - "B": { - plotter: barChartPlotter + series: { + "A": { + strokeWidth: 2 + }, + "B": { + plotter: barChartPlotter + } } }); @@ -314,12 +316,14 @@ var candleData = "Date,Open,Close,High,Low\n" + 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 + } } }); diff --git a/tests/steps.html b/tests/steps.html index 8c58811..dd9ff5c 100644 --- a/tests/steps.html +++ b/tests/steps.html @@ -131,7 +131,11 @@ labels: ["Date","GapSeries1","GapSeries2"], showRoller: true, stepPlot: true, - GapSeries2: { axis: {} } + series: { + GapSeries2: { + axis: 'y2' + } + } } ); diff --git a/tests/two-axes.html b/tests/two-axes.html index e3e29ff..24f717a 100644 --- a/tests/two-axes.html +++ b/tests/two-axes.html @@ -48,12 +48,13 @@ 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: { diff --git a/tests/value-axis-formatters.html b/tests/value-axis-formatters.html index 193c48e..184101e 100644 --- a/tests/value-axis-formatters.html +++ b/tests/value-axis-formatters.html @@ -50,12 +50,9 @@ 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,