Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Unable to zoom and display crosshair in chart
posted

Hi,

I have 2 charts on webpage, while they have no issue displaying the series but then the chart cannot be interacted: it cannot be zoom in, crosshair doesn't show when mouse hover over the chart area, and no tooltip is show when click on data point.

Currently .NET Core project reference to IgniteUI 22.2.3 and Infragistics.Web.AspNetCore 6.22.2.7. Below is the code for the chart, the same code is use in old C# project that reference to old Infragistics library (forgot the actual version, should be around 2015's) and it works.

Chart.cshtml  

using Infragistics.Web.Mvc
@model SomeViewModel

@(Html.Infragistics().Loader()
            .ScriptPath(Url.Content("~/js/IgniteUI/"))
            .CssPath(Url.Content("~/css/IgniteUI/"))
            .Theme("bootstrap")
            .Render())

@if (Model != null && Model.Measurements != null && Model.Measurements.Count() > 0)
{
    @(Html.Infragistics().DataChart(Model.Measurements[0].StatData.AsQueryable())
        .ID("ss_chart")
        .Width("95%")
        .Height("200px")
        .VerticalZoomable(true)
        .HorizontalZoomable(true)
        .CrosshairVisibility(Visibility.Visible)
        .Axes(axes =>
            {
                axes.CategoryX("MessageTime").Label(d => d.MessageTimeString)
                .Interval(10).LabelVisibility(Visibility.Visible);

                axes.NumericY("SS").Title(Model.SignalStrengthChartLabel).MaximumValue(Model.SSChartYAxesMax).MinimumValue(Model.SSChartYAxesMin).FormatLabel("function (item) { return GetFormattedChartDecimalValue(item);}");
            })
        .Series(series =>
            {

                for (int i = 0; i < Model.Measurements.Count; i++)
                {
                    series.Line("Y_" + i, Model.Measurements[i].StatData.AsQueryable())
                            .XAxis("MessageTime")
                            .YAxis("SS")
                            .ValueMemberPath(d => d.SS)
                            .ShowTooltip(true)
                            .MarkerType(MarkerType.Circle)
                            .Brush(Model.Measurements[i].Color)
                            .MarkerBrush(Model.Measurements[i].Color)
                            .TrendLineBrush(Model.Measurements[i].Color)
                            .TooltipTemplate("ss_chart_tooltipTemplate")
                            .Title(Model.Measurements[i].Name);
                }
            }
        )
        .DataBind()
        .Render()
    )
}

<script id="ss_chart_tooltipTemplate" type="text/x-jquery-tmpl">

    <div style="">
        <span>Cell : </span><span>${item.Name}</span><br/>
        <span>SS : </span><span>${item.SS}</span><br/>
        <span>Time : </span><span>${item.MessageTimeString}</span><br/>
        @*<span>Event : </span><span>
        <img class='infoPanelIcon' src='${item.Icon}' alt='' />*@
        </span><br/>
    </div>
</script>


Am I missing any configuration in the code, or do I need to reference to extra packages?


Parents Reply Children
No Data