morrisjs / morris.js

Pretty time-series line graphs
http://morrisjs.github.com/morris.js/
6.92k stars 1.23k forks source link

Multi Point Charts #795

Open ValeryKuz opened 4 years ago

ValeryKuz commented 4 years ago

is it possible to do something like this? https://canvasjs.com/javascript-charts/multi-series-scatter-point-chart/

or make a chart of dots and color negative values different color?

pierresh commented 4 years ago

Yes, you can do a line chart with the option lineWidth set to 0.

ValeryKuz commented 4 years ago

Yes, you can do a line chart with the option lineWidth set to 0.

but i want two different colors as the sample has

pierresh commented 4 years ago

You can do two series (or more), each series would have its own color.

ValeryKuz commented 4 years ago

You can do two series (or more), each series would have its own color.

is there any sample? how do i create two series? tnx

pierresh commented 4 years ago

you can try with this

Morris.Line({
    element: 'chart_line',
    lineWidth: 0,
    data: [
        { year: '1958', nb: 90, e: null },
        { year: '1962', nb: null, e: 2 },
        { year: '1970', nb: 20, e: 4 },
        { year: '1994', nb: 10, e: null },
        { year: '2002', nb: 10, e: 20 },
    ],
    xkey: 'year',
    ykeys: ['nb', 'e'],
    labels: ['nb', 'e']
});