DmitryBaranovskiy / g.raphael

Charts for Raphaël
http://g.raphaeljs.com/
1.52k stars 435 forks source link

Paper.linechart() does not support valuesy > 10 #193

Open drmarduk opened 10 years ago

drmarduk commented 10 years ago

"does not support" is not quite right, it does support > 10 dataarrays but they do not have a color setting via default settings. It works well, if

opts.colors.length == valuesy.length

One fix: Generate more than 10 default colors in g.raphael.js line 703, or: add something like

if(valuesy.length > colors.lengt) {
    var missingcolorcount = valuesy.length - colors.length;
    for(var i = 0; i < missingcolorcount; i++) {
       colors.push('hsb(0.75, 0.75, 0.75'); // static color, can be changed.
    }
}

in g.line.js at line 78++ after the color settings are set from g.color.