score:1
I had the same problem for a long time. I finally found that i needed to clear the dataset and add the new data back into a new dataset then update the chart.
I am clearing the data set with _lineConfig.Data.Datasets.Clear();
then create a new version as below
TempProductionLineTotal = SqlProdData.GetProductionTotals(searchDate[0], searchDate[1]);
_productionDataSet = new LineDataset<TimeTuple<int>>
{
BackgroundColor = ColorUtil.FromDrawingColor(System.Drawing.Color.Orange),
BorderColor = ColorUtil.FromDrawingColor(System.Drawing.Color.Orange),
Label = "Daily Total",
Fill = false,
BorderWidth = 2,
PointRadius = 1,
PointBorderWidth = 2,
SteppedLine = SteppedLine.False,
Hidden = false,
LineTension = 0.0 };
_productionDataSet.AddRange(TempProductionLineTotal
.Select(p => new TimeTuple<int>(new Moment(p.DateNTime),Convert.ToInt32(p.Daily_Lineal))));
_lineConfig.Data.Datasets.Add(_productionDataSet);
Source: stackoverflow.com
Related Query
- Chartjs - keeping 2 graphs aligned side by side
- Blazor server-side Chartjs
- Side effects from Chartjs for only *some* clients
- How to add ChartJS code in Html2Pdf to view image
- How do I add time sourced from an external source as an X axis to a ChartJS graph?
- chartJS label on each side of the chart
- Execute script after loading server side rendered React component
- Chartjs not working with d3 from csv source
- How to align labels at same side chartjs React
- ChartJS have xAxes labels match data source
- Updating Chartjs to 2.5 with custom code
- To display data from mock server into chartjs using ember
- How can I move chartJs legend left side and change the width and Hight of the chart?
- Calling data from outside of Chartjs code
- VueJS + Chartjs - Chart only renders after code change
- How to show label at right side of Y axis same as left side of Y Axis ChartJS
- How to keep side bars in Chartjs bar graph from clipping?
- Providing server side data for Chart.js charts
- ChartJS 2.0 differences in code help needed
- How can I put my label on the right hand side of my chart in Chartjs
- My Chartjs is not updating after setstate full code attached Reactjs Update
- Update data from server for ChartJS graph
- Boxplot chartjs make min and max dynamic by leaving some space on both side
- Chartjs doc examples are lightning fast but same code is slow when reproducing
- 'require is not defined' error when attempting to use chartjs in javascript code
- ChartJS - Returning labels and data from server on different calls
- How to run Chart.js samples using source code
- Code for Chartjs Typescript definition file
- Dynamically update values of a chartjs chart
- Different color for each bar in a bar chart; ChartJS
More Query from same tag
- React ChartJS 2 : Get data on clicking the chart
- How to compute x,y values from a click event using x,y pixel coordinates in ChartJS?
- cannot read property 'yyyx' of undefined
- What are these line-boxes called in Chart.js, and how do I turn them off?
- Display only certain labels with chart.js
- React render Chart.js based on api response
- Creating dynamic arrays in Angular2
- The chart doesn't display the data from my call to the API with Axios
- chartjs creating data array dynamically
- Chart js how to toggle line without click
- Calculating Bar Chart Percentage
- Chart.js: refresh second Y axis step on legend click
- Angular 5 and chart.js ts error
- Angularjs - Charts.js: Same chart element doesn't redraw on other view
- ChartJs Memory Leak | Garbage Collection does not clean Chart Object or Arrays after render
- How can I add some text in the middle of a half doughnut chart in Chart.JS?
- Remove additional white space on left and right side of Angular Chart
- ChartJS Doughnout Chart Pie Offset on Hover
- How to set specific height for chartJs background color in terms of yAxis value
- Bootstrap modal showing when clicking individual points in Linechart but not in individual bars in Barchart
- Could not find elementById on mat-card-content
- Chart.js - Scale of secondary Y axis
- Line ChartJS empty / null values doesn't break the line
- Chart.js - make barchart element blink
- Grouped bar charts, in chart.js
- Reactive Vue Chart.js component using Typescript
- Angular + Ng2 Charts: Chart not displaying as Child Component
- How to install chartjs on laravel 6 via npm
- Format chart.js x-axis labels to specific timezone
- Shorten number labels in Charts.js