Open mortezabarzkar opened 2 months ago
it work after change
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
to
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
Thanks for posting the solution.
@stsrki After restarting the application pool, it works for the first time at startup, but when I refresh it, the chart still does not appear.
We host our web and demos on IIS, so it should work.
@stsrki am I doing something wrong somewhere?
@using Blazorise.Charts.Streaming
<Card>
<CardBody>
<Grid>
<LineChart @ref="horizontalLineChart" TItem="LiveDataPoint" OptionsObject="@horizontalLineChartOptions">
<ChartStreaming TItem="LiveDataPoint"
Options="new ChartStreamingOptions { Delay = 0,Duration = 900000,Refresh=5000 }"
Refreshed="@OnHorizontalLineRefreshed" />
</LineChart>
</Grid>
</CardBody>
</Card>
LineChart<LiveDataPoint> horizontalLineChart;
List<LiveDataPoint> liveDataPoints = new List<LiveDataPoint>();`
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
try
{
var data = await GetInitData.Invoke();
foreach( var item in data)
logger.Info($"{Title} {item.time} -> {item.cnt}");
if (data?.Any() ?? false)
{
foreach (var item in data.OrderBy(c => c.time).ToList())
{
liveDataPoints.Add(new LiveDataPoint
{
X = item.time,
Y = item.cnt,
});
}
lastRecive = data.Max(c => c.time);
}
await Task.WhenAll(
HandleRedraw(horizontalLineChart, GetLineChartDataset1));
await horizontalLineChart.Resize();
await InvokeAsync(StateHasChanged);
}
catch (Exception ex)
{
logger.Error(ex);
}
}
}
async Task HandleRedraw<TDataSet, TItem, TOptions, TModel>(BaseChart<TDataSet, TItem, TOptions, TModel> chart, params Func<TDataSet>[] getDataSets)
where TDataSet : ChartDataset<TItem>
where TOptions : ChartOptions
where TModel : ChartModel
{
await chart.Clear();
await chart.AddLabelsDatasetsAndUpdate(Labels, getDataSets.Select(x => x.Invoke()).ToArray());
}
LineChartDataset<LiveDataPoint> GetLineChartDataset1()
{
return new LineChartDataset<LiveDataPoint>
{
Data = liveDataPoints,
Label = Title,
BackgroundColor = backgroundColors[1],
BorderColor = borderColors[1],
//Fill = true,
Tension = 0,
ShowLine = true,
SpanGaps = true,
//BorderDash = new List<int> { 8, 4 },
};
}
Hi, i have live chart on my page, and it workes perfectly on IISExpress , but when i published it on IIS chart dataset dose not loaded.
Is it a known feature in the trial version?