question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failing to plot a simple List<double> with 8760 points as a line chart

See original GitHub issue

Hello guys,

I just came across this library, this is fantastic, thanks for the work! I’ve succeeded in creating really complex graphs with so few lines of code that now I want to convert all my graphs! Here goes some examples:

image

and this is all the code I wrote:

<ApexCharts.ApexChart TItem="Zone"> <ApexCharts.ApexPointSeries TItem="Zone" Items="building.Zones.Where(x => x.REVITOccupation > 0)" SeriesType="ApexCharts.SeriesType.Pie" XValue="@(e => e.REVITSpaceKey)" OrderBy="@(e => e.X)" YAggregate="@(e => e.Sum(e => e.REVITOccupation))" /> </ApexCharts.ApexChart>

That’s incredible. My previous library would require me to write code in WASM and in C#… Thanks again for the porting.

But the reason I’m writing is that I can’t seem to be able to create the most simple kind of graph, a List of doubles. I am trying to do something like this: image

and i was expecting the code to be as short as the last one, so I wrote the following: <ApexCharts.ApexChart TItem="double"> <ApexCharts.ApexPointSeries TItem="double" Items="@this.BuildingInUse.Heat.Space.Hourly" SeriesType="Apex.SeriesType.Line" YValue="@(e => e)" Name="Space Heating" /> </ApexCharts.ApexChart>

where the Item supplied is of type List<double>. I can’t compile it, says that my YValue needs to be of decimal type.

I’ve looked in the documentation, but there are no examples of how to deal with a large dataset of 10.000 points, for example. Any help would be appreciated.

Issue Analytics

  • State:closed
  • Created 8 months ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
joadancommented, Mar 17, 2023

Hello,

Thank you for the repo.

The bulk of the time is for the browser to render the chart. it has nothing to do with the wrapper. Apexchart is svg based this means that every object is an SVG node and if the number of nodes is high then it takes a long time for the browser to render the chart. I turned of XAxis labels and ticks in your sample and was able to get a much better response.

However I think you should really consider if you have to render so many points at the same time. It hard for anyone to make something out of that chart. Would it be an option to group the data?

0reactions
sweco-bepedmcommented, Mar 11, 2023

Hey there joadan,

It took me quite some time but, as promised, I got back to you, and this time with all the sauce so you can test it on your side. I’ve created a little repo showing a page taking never less than 30 seconds to load a line graph with 8760 points. Here is the repo:

https://github.com/sweco-bepema/ApexChartTest

Read more comments on GitHub >

github_iconTop Results From Across the Web

Line Chart Not Plotting Data Points
I have a Line Graph that plots multiple series of data points based on the selected options chosen above. Whenever I Group By...
Read more >
Plotting 8760 time series data on the x axis
Hello - I have 8760 lines of data each representing one hour of consecutive energy data in a year. I would like to...
Read more >
A Complete Guide to Line Charts
Strictly using a zero-value baseline · Failing to identify uneven gaps between points · Interpolating a curve between points · Using a misleading...
Read more >
A Line chart may plot gaps in lines when the data range ...
Describes an issue where the lines of a Line chart may plot with gaps when the data range of the chart contains blank...
Read more >
Unable to build simple line graph - Microsoft Fabric Community
Morning All, Trying to build a simple line graph. I have 3 years worth of data from 4 different shops showing how many...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found