You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the InvientCharts with Vaadin and I want to make a line chart to which I add a new data point each second.
The problem is that the InvientCharts.addPoint operation takes around 0.5ms x number of points in the graph. Also the getPoints takes around the same time. So by the time i have a few hundreds points in the graph, the thing becomes unusable.
I need to be able to store a few thousands points.
The text was updated successfully, but these errors were encountered:
btw, please see below the stack trace while the getPoints is running.
Basically adding points into a hash involves doing lots of calendar operations.
at sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate(BaseCalendar.java:434)
at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2098)
at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2013)
at java.util.Calendar.setTimeInMillis(Calendar.java:1126)
at java.util.GregorianCalendar.<init>(GregorianCalendar.java:593)
at java.util.Calendar.createCalendar(Calendar.java:1028)
at java.util.Calendar.getInstance(Calendar.java:965)
at com.invient.vaadin.charts.InvientCharts.getDateInMilliseconds(InvientCharts.java:363)
at com.invient.vaadin.charts.InvientCharts.access$0(InvientCharts.java:359)
at com.invient.vaadin.charts.InvientCharts$DateTimePoint.equals(InvientCharts.java:2900)
at java.util.HashMap.put(HashMap.java:393)
at java.util.HashSet.add(HashSet.java:217)
at java.util.AbstractCollection.addAll(AbstractCollection.java:322)
at java.util.LinkedHashSet.<init>(LinkedHashSet.java:169)
at com.invient.vaadin.charts.InvientCharts$Series.getPoints(InvientCharts.java:3173)
at com.invient.vaadin.charts.InvientCharts$DateTimeSeries.getPoints(InvientCharts.java:3647)
My solution was to create an override of the series class, the updatePointXValuesIfNotPresent-function is called for every addPoint and does a lot of unnecessary work if you have x-values defined on your points:
public class ModifiedDateTimeSeries extends InvientCharts.DateTimeSeries {
...
protected void updatePointXValuesIfNotPresent() {
// do nothing
}
}
I'm using the InvientCharts with Vaadin and I want to make a line chart to which I add a new data point each second.
The problem is that the InvientCharts.addPoint operation takes around 0.5ms x number of points in the graph. Also the getPoints takes around the same time. So by the time i have a few hundreds points in the graph, the thing becomes unusable.
I need to be able to store a few thousands points.
The text was updated successfully, but these errors were encountered: