DyGraphs 默认绘图仪叫什么 - 或者我如何定义它?

What is DyGraphs default plotter called - or how do I define it?

我使用记录的 barChartPlotter() 绘制条形图,但有时我想绘制默认折线图。

如何定义一个 "defaultChartPlotter" 以便我可以绘制?

                    g.updateOptions({
                        'file': dataToday, title: graphTitle, dateWindow: newDateWindow,
                        ylabel: yAxisType,
                        plotter: generalChartPlotter
                        }
                    });

function generalChartPlotter(e) {
         if(myChartTypeFlag=="BAR")
             return barChartPlotter(e);
         else
             return defaultChartPlotter(e);
}

function defaultChartPlotter(e) {
             //What do I put here to get line default chart?
}


function barChartPlotter(e) {

            var ctx = e.drawingContext;
            var points = e.points;
            var y_bottom = e.dygraph.toDomYCoord(0);

            ctx.fillStyle = darkenColor(e.color);

            // Find the minimum separation between x-values.
            // This determines the bar width.
            var min_sep = Infinity;
            for (var i = 1; i < points.length; i++) {
                var sep = points[i].canvasx - points[i - 1].canvasx;
                if (sep < min_sep) min_sep = sep;
            }
            var bar_width = Math.floor(2.0 / 3 * min_sep);

            // Do the actual plotting.
            for (var i = 0; i < points.length; i++) {
                var p = points[i];
                var center_x = p.canvasx;

                ctx.fillRect(center_x - bar_width / 2, p.canvasy,
                    bar_width, y_bottom - p.canvasy);

                ctx.strokeRect(center_x - bar_width / 2, p.canvasy,
                    bar_width, y_bottom - p.canvasy);
            }
        }

这似乎是默认设置:

Dygraph.Plotters.linePlotter(e);