Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeline XAxis #519

Open
MrStamina opened this issue Oct 16, 2024 · 2 comments
Open

Timeline XAxis #519

MrStamina opened this issue Oct 16, 2024 · 2 comments

Comments

@MrStamina
Copy link

MrStamina commented Oct 16, 2024

Hello, I have the following ApexChart :
image

My Code :

<ApexChart TItem="FurnaceMeasurementChartDataPoint" Title="Top Zone"
           Options="@optionsTop" @ref=chartTop Height="400" >
    @foreach (var series in _seriesTop)
    {
        <ApexPointSeries TItem="FurnaceMeasurementChartDataPoint"
                         Items="@series.Items"
                         Name="@series.Name" Stroke="@series.Stroke"
                         SeriesType="SeriesType.Line"
                         XValue="@series.XValue"
                         YValue="@series.YValue" OrderBy="e =>e.X"/>
    }
</ApexChart>
MyXAxis in ApexChartOptions :
 
 Xaxis = new XAxis
 {
     Title = new AxisTitle
     {
         Text = "Time", 
     },
     Type = XAxisType.Datetime,
     Min = _listTop.Min(p => p.Time),
     Max = _listTop.Max(p => p.Time),
 },

So the issue is the following : the chart is displaying the last hour before with a wrong date start (24 on the image, all my data are from the 27). I checked multiple time my data from the json and the c# list who provide the series, and according to me there is no mistake. I don't know why the chart has this behaviour. Thanks in advance

@joadan
Copy link
Member

joadan commented Oct 26, 2024

Not sure what could be the issue but it sounds like it could be timezone related

@joadan
Copy link
Member

joadan commented Oct 26, 2024

sorry I misread you post.. looks like you are 3 days off, so it's not timezone.

There is no magic here that could explain the difference.
One tip is to use the method ToUnixTimeMilliseconds() to set the x-axis data, Apexcharts.js is using that under the hood.
You can also set the Debug flag on the chart to see the data send to the chart in the console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants