ramnathv / rCharts

Interactive JS Charts from R
http://rcharts.io
Other
1.19k stars 654 forks source link

test and support Rickshaw [multi renderer](https://github.com/shutterstock/rickshaw/pull/71) #101

Open timelyportfolio opened 11 years ago

timelyportfolio commented 11 years ago

In Rickshaw request 71 https://github.com/shutterstock/rickshaw/pull/71 , they have added support for a multi renderer to support things such as a chart with stack, scatterplot, and bat as shown with the example provided. renderer is specified within the series object rather than at one higher level, so

old way

var graph = new Rickshaw.Graph( {
    element: document.getElementById("chart"),
    width: 960,
    height: 500,
    renderer: 'line',
    series: [
        {
            color: "#c05020",
            data: seriesData[0],
            name: 'New York'
        }, {
            color: "#30c020",
            data: seriesData[1],
            name: 'London'
        }, {
            color: "#6060c0",
            data: seriesData[2],
            name: 'Tokyo'
        }
    ]
} );

new way for multi

var graph = new Rickshaw.Graph( {
    element: document.getElementById("chart"),
    renderer: 'multi',
    width: 900,
    height: 500,
    dotSize: 2,
    series: [
        {
            name: 'temperature',
            data: seriesData.shift(),
            color: 'rgba(255, 0, 0, 0.4)',
            renderer: 'stack'
        }, {
            name: 'heat index',
            data: seriesData.shift(),
            color: 'rgba(255, 127, 0, 0.4)',
            renderer: 'stack'
        }, {
            name: 'dewpoint',
            data: seriesData.shift(),
            color: 'rgba(127, 0, 0, 0.3)',
            renderer: 'scatterplot'
        } ...
ramnathv commented 11 years ago

This is neat. It should be fairly easy to implement this, as it is similar to a layered approach followed in other libraries.

ghost commented 10 years ago

Has there been any progress towards implementing this?

ramnathv commented 10 years ago

No. We have been working towards documenting existing functionality in rCharts and cleaning up some of the core functions. We will start focusing of feature enhancements once we have things in place.

If you need this feature ASAP, I can give you some pointers on how to go about customizing the default Rickshaw layout to achieve what you want.

ghost commented 10 years ago

That's understandable. Any pointers or suggestions you could provide to get me started would be great.