Unplanned
Last Updated: 14 Dec 2020 11:01 by ADMIN
Chris
Created on: 14 Dec 2020 11:00
Category: Charts
Type: Feature Request
3
SeriesOver and SeriesLeave events

Like in Kendo (here and here) so I can change the cursor for the chart to a pointer when the user hovers the series - I want that to indicate they can click on it (through the SeriesClick event).

---

ADMIN EDIT

 

workaround that you can consider which uses CSS to traverse the chart rendering:

<style>
    /* this will work in the chart below with its settings, axes, title and so on */
    .k-chart g[clip-path] g g g path {
        cursor: pointer;
    }

    /* a very generic selector that will capture just about everything in the plot area of the chart */
    /* Try this if you cannot make a more specific selector like the one above by inspecting the rendered content */
    /*.k-chart path {
        cursor: pointer;
    }*/
</style>

<TelerikChart>
    <ChartSeriesItems>
        <ChartSeries Type="ChartSeriesType.Column" Name="Product 1" Data="@series1Data">
        </ChartSeries>
        <ChartSeries Type="ChartSeriesType.Column" Name="Product 2" Data="@series2Data">
        </ChartSeries>
    </ChartSeriesItems>

    <ChartCategoryAxes>
        <ChartCategoryAxis Categories="@xAxisItems">
        </ChartCategoryAxis>
    </ChartCategoryAxes>

    <ChartTitle Text="Quarterly revenue per product"></ChartTitle>

    <ChartLegend Position="ChartLegendPosition.Right">
    </ChartLegend>
</TelerikChart>

@code {
    public List<object> series1Data = new List<object>() { 10, 2, 5, 6 };
    public List<object> series2Data = new List<object>() { 5, 8, 2, 7 };
    public string[] xAxisItems = new string[] { "Q1", "Q2", "Q3", "Q4" };
}

---

0 comments