Closed gy6248 closed 3 years ago
I think the bug is in chart.min.js and it appears to have been fixed in Chart.js v2.9.3 Blazor ChartJs 1.0.3 includes v2.8.0 of this file. With the new chart.min.js file my curve was drawn OK.
Thanks for the report!
As you already mentioned in your second comment, I don't think this is an issue with our library but a bug inside chartjs. However, we're currently on 2.8 and not 2.9. There are some changes for our library when upgrading but it should be done as soon as possible.
Working aroundd this issue shouldn't be too hard though. Just include the new version of chart.js and if there are breaking changes which we haven't adapted to yet, file an issue; it'll greatly help us upgrade!
Once again I have to mention that I don't have time to actively maintain this library at the moment. I don't know if @mariusmuntean will be able to pick up work again or if it'll stay in this state for a while (I hope you'd understand as this is all voluntary, unpaid work). Unfortunately, I don't know when I will get more free time to invest in this project.
I will close this issue once we officially support Chart.js 2.9. This should be the case in Version 2.0 in which we'll remove the bundled version of Chart.js from this library.
I'm closing this now as 2.0 is almost done and will be released soon.
Describe the bug
For some combinations of points with small Y value the scatterChart will cause a crash. It seems to relate to the auto scaling of the Y axis, specifically the formatting of the numbers on the Y-axis.
I have included the four point triggering an error in my installation below. Changing the Y-value on the second OR third number to E-04/ E-05 respectively will make the curve plot OK.
Which Blazor project type is your bug related to?
Which charts does this bug apply to?
ChartJsScatterChart
To Reproduce
Steps to reproduce the behavior:
Using this version of ChartJSBlazor 1.0.3
Run this code Use the scatterChart sample code, but add only one curve with four points
With these arguments '....'.
See error.
Expected behavior
Draw the curve
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context / logging
Add any other context about the problem here.
[2020-02-10T12:22:14.707Z] Information: WebSocket connected to wss://localhost:44379/_blazor?id=tf3PtwnSTeM88X1Vw0sSNw. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Users\gy6248\source\repos\ChartJs.Blazor\ChartJs.Blazor-master\samples\ServerSide\ChartJs.Blazor.Sample.ServerSide\bin\Debug\netcoreapp3.1\ChartJs.Blazor.dll'. Symbols loaded. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.0\Microsoft.CSharp.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Users\gy6248\source\repos\ChartJs.Blazor\ChartJs.Blazor-master\samples\ServerSide\ChartJs.Blazor.Sample.ServerSide\bin\Debug\netcoreapp3.1\Newtonsoft.Json.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.0\System.Runtime.Serialization.Formatters.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.0\System.Diagnostics.TraceSource.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.0\System.Runtime.Serialization.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.0\System.Runtime.Numerics.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.0\System.Data.Common.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Exception thrown: 'Microsoft.JSInterop.JSException' in System.Private.CoreLib.dll 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.0\System.Diagnostics.StackTrace.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.0\System.Reflection.Metadata.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.0\System.Collections.Immutable.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer: Warning: Unhandled exception rendering component: toExponential() argument must be between 0 and 100 RangeError: toExponential() argument must be between 0 and 100 at Number.toExponential ()
at i.linear (https://localhost:44379/_content/ChartJs.Blazor/Chart.min.js:7:102036)
at Array.map ()
at i.convertTicksToLabels (https://localhost:44379/_content/ChartJs.Blazor/Chart.min.js:7:105530)
at i.convertTicksToLabels (https://localhost:44379/_content/ChartJs.Blazor/Chart.min.js:7:117293)
at i.update (https://localhost:44379/_content/ChartJs.Blazor/Chart.min.js:7:104107)
at https://localhost:44379/_content/ChartJs.Blazor/Chart.min.js:7:71859
at Object.each (https://localhost:44379/_content/ChartJs.Blazor/Chart.min.js:7:23303)
at Object.update (https://localhost:44379/_content/ChartJs.Blazor/Chart.min.js:7:71762)
at ni.updateLayout (https://localhost:44379/_content/ChartJs.Blazor/Chart.min.js:7:96121)
Code example