Open RHaughton opened 3 months ago
It's not currently supported in this library, no. You can do it using the underlying javascript library though.
I'm a bit reluctant to make changes to this library since it's practically legacy. But it's really just supposed to be simple interop with TradingView Lightweight anyway, anything advanced should probably not be done with TradingView.Blazor.
You can define the data in c# and pass it in with code you can use from this file in my library.
And the JS is something along the lines of:
// Set up the main chart container
const chart = createChart(document.body, { width: 600, height: 300 });
// Create two line series
const lineSeries1 = chart.addLineSeries({
color: 'blue',
lineWidth: 2,
});
const lineSeries2 = chart.addLineSeries({
color: 'red',
lineWidth: 2,
});
// Sample data for the first series
lineSeries1.setData([
{ time: '2021-01-01', value: 50 },
{ time: '2021-02-01', value: 57 },
{ time: '2021-03-01', value: 66 },
]);
// Sample data for the second series
lineSeries2.setData([
{ time: '2021-01-01', value: 48 },
{ time: '2021-02-01', value: 60 },
{ time: '2021-03-01', value: 68 },
]);
// Optionally, configure the scale or any other chart settings
chart.timeScale().fitContent();
Hi,
I'm having issues adding a second series to a chart. Here is my code:
I've also tried:
Am I doing something wrong or the library doesn't support this case?
Thanks for your help