esnet / react-timeseries-charts

Declarative and modular timeseries charting components for React
http://software.es.net/react-timeseries-charts
Other
865 stars 283 forks source link

styling doesn't work when column name is changed in baselines example #352

Open donfour opened 5 years ago

donfour commented 5 years ago

Hi! I was going through the baselines sample code to see how styling works. My understanding is that the key in the style object has to match the column name of your TimeSeries, i.e.:

const series = new TimeSeries({
    name: "USD_vs_EURO",
    columns: ["time", "value"], <-- this
    points
});

const style = {
    value: { <-- matches this
        stroke: "#a02c2c",
        opacity: 0.2
    }
};

However, when I change both of these values to, let's say, "test" like so:

const series = new TimeSeries({
    name: "USD_vs_EURO",
    columns: ["time", "test"],
    points
});

const style = {
    test: {
        stroke: "#a02c2c",
        opacity: 0.2
    }
};

the plot stops working.

screen shot 2018-12-27 at 11 23 36 am

Am I missing anything? Do I have to change value to test any other places? Thanks in advance!

donfour commented 5 years ago

problem solved by going to react-vis