-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting Series name #5
Comments
@mbugbee You can achieve it with customizing anychart-react.jsx file. Find createAndDraw(prevProps) {} function and customize it like this:
|
ah, editing files in an npm module doesn't seem like a great long term solution as the edit would be reverted anytime the dependency was updated or pulled in other environments. This would also force every chart using anychart-react to have the same series 0 name. |
@mbugbee I have a better solution for how you can set a series name and customize deeply your chart. If you do not use an instance property of a component, properties go exactly as they go in AnyChart JavaScript API. An example of such chart configuration below: // create data
var data = [
["January", 10000],
["February", 12000],
["March", 18000],
["April", 11000],
["May", 9000]
];
// create a chart
var chart = anychart.line();
// create a line series and set the data
var series = chart.line(data);
//set series name
series.name('Series name');
ReactDOM.render(
<AnyChart
width='100%'
height='100%'
instance={chart}
title="Simple pie chart"
/>, document.getElementById('root')); |
What's the proper way to set the name of a series with anychart-react?
The text was updated successfully, but these errors were encountered: