Detailed example for ApexRangeSeries
See original GitHub issueHejsån! Great charts, just wish there would be more detailed examples somewhere and wider audience for keeping this repo alive and actively maintained. I have got majority of examples working, but can’t figure out how you managed ApexRangeSeries functioning.
I have seen documentation: https://apexcharts.github.io/Blazor-ApexCharts/rangebar-charts
Basically I am trying to imitate GanttChart with this chart, so I came up with this model:
protected async override Task OnInitializedAsync()
{
this.ProjectsList = await this.HttpClient.GetFromJsonAsync<IEnumerable<Project>>("api/Projects");
this.InitializeGanttChartOptions();
this.GanttChart = this.ProjectsList
.Select(s => new GanttChartModel
{
XAxisValue = s.Name,
YAxisValue = new List<decimal> { s.ProjectStartDate.Ticks, s.ProjectEndDate.Ticks },
}).ToList();
}
Then razor part:
<ApexChart TItem="GanttChartModel"
Title="Gantt view"
Options=Options
XAxisType="XAxisType.Datetime">
<ApexRangeSeries TItem="GanttChartModel"
Items="this.GanttChart"
XValue="@(e => e.XAxisValue)"
YValue="@(e => e.YAxisValue)" />
</ApexChart>
So at this point YValue is decimal, but for getting range it should be public IEnumerable<decimal> YAxisValue { get; set; }
. How to get it working?
My model:
public class GanttChartModel
{
public object XAxisValue { get; set; }
public IEnumerable<decimal> YAxisValue { get; set; }
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Retrieve DateTimeOffset pairs from linq query
I have an example that is working. However in real world scenario I am getting data from linq query. How to receive data...
Read more >Newest 'apexcharts' Questions - Stack Overflow
I've create ASP.Net core solution and some details of item will be displayed in bootstrap modal as chart (apexChart library). Chart appear ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have now added the option to set YMin/Max value on the ApexRangeSeries. Check it out at https://apexcharts.github.io/Blazor-ApexCharts/rangebar-charts#date range . There is a new nuget version 0.6.1-alpha.
Formatting Datetime X Axis is described here, https://apexcharts.com/docs/datetime/ Docs for the X-Axis options, here https://apexcharts.com/docs/options/xaxis/
For the dynamic height I guess you should be able to set the the height on the chart calculated from the number of items in the list.
Please let me know if there are questions.
Clean up