PMSI-AlignAlytics / dimple

An object-oriented API for business analytics
Other
2.73k stars 557 forks source link

stacked = false AreaChart has wrong color #188

Open confile opened 9 years ago

confile commented 9 years ago

I used this code (http://jsfiddle.net/5bxbk39k/2/):

        var data = [
                    { Date: "2015-09-14", DayOfMonth: 14, Type: "Views", Amount: 5, y1: 10, },
                    { Date: "2015-09-14", DayOfMonth: 14, Type: "Likes", Amount: 2, y1: 15, },
                    { Date: "2015-09-15", DayOfMonth: 15, Type: "Views", Amount: 10, y1: 35, },
                    { Date: "2015-09-15", DayOfMonth: 15, Type: "Likes", Amount: 4, y1: 20, },
                    { Date: "2015-09-16", DayOfMonth: 16, Type: "Views", Amount: 14, y1: 22, },
                    { Date: "2015-09-16", DayOfMonth: 16, Type: "Likes", Amount: 10, y1: 22, },
                    { Date: "2015-09-17", DayOfMonth: 27, Type: "Views", Amount: 20, y1: 22, },
                    { Date: "2015-09-17", DayOfMonth: 27, Type: "Likes", Amount: 12, y1: 22, },
                ];

var svgWidth = $("#chart").width(),
    svgHeight = $("#chart").height();

var svg = dimple.newSvg("#chart", svgWidth, svgHeight);
var chart = new dimple.chart(svg, data);
var xAxis = chart.addCategoryAxis("x", "DayOfMonth");
xAxis.title = null;
xAxis.addOrderRule("Date");
var yAxis = chart.addMeasureAxis("y", "Amount");
yAxis.title = null;

var series = chart.addSeries("Type", dimple.plot.area);
series.stacked = false;
//series.interpolation = "cardinal";

var legend = chart.addLegend(0, 20, 300, 20, "right");

chart.draw();

As from the data, likes are always smaller than views but the graph shows differnt.

edit_fiddle_-_jsfiddle

vitalif commented 8 years ago

+1, I experience the same issue.