Can't find PointRender
Hello. I used the example from the Syncfusion website, and I'm getting a bunch of errors, the first of which is the in the using statement it can't find the PointRender. Does anyone know the namespace I should use? This is a Blazor server application. Thank you so much
Hi Joshua,
We have analyzed your reported issue with the PointRender. The PointRender can be used to change the color based on the selected themes for the chart demos, which is for internal purposes. To overcome the bunch of errors, you can remove the PointRender and ThemeHelper namespace reference code from the chart sample. We have used the Remote Data demo sample to demonstrate removing the errors and have also attached a sample and screenshot for your reference. Please check the code snippet below.
|
@using Syncfusion.Blazor @using Syncfusion.Blazor.Data @using Syncfusion.Blazor.Charts
@using PointRender @using ThemeHelper; @inject NavigationManager NavigationManager <div class="control-section" align='center'> <SfChart Title="Food Vs Price" Width="@Width" Theme="@Theme"> <!-- Chart configurations --> </SfChart> </div> @code { // Chart configurations protected override void OnInitialized() { Theme = ThemeHelper.GetCurrentTheme(NavigationManager.Uri); if (SampleService.IsDevice) { Label = LabelIntersectAction.None; Rotation = -45; Width = "100%"; } } public void PointRender(PointRenderEventArgs args) { this.SetTheme(args); } private void SetTheme(PointRenderEventArgs args) { if (NavigationManager.Uri.IndexOf("material3") > -1) { if (NavigationManager.Uri.IndexOf("dark") > -1) { if (args == null) Theme = Theme.Material3Dark; else args.Fill = PointColor.Material3DarkColors[args.Point.Index % 10]; } else { if (args == null) Theme = Theme.Material3; else args.Fill = PointColor.Material3Colors[args.Point.Index % 10]; } } else if (NavigationManager.Uri.IndexOf("material") > -1) { if (NavigationManager.Uri.IndexOf("dark") > -1) { if (args == null) Theme = Theme.MaterialDark; else args.Fill = PointColor.MaterialDarkColors[args.Point.Index % 10]; } else { if (args == null) Theme = Theme.Material; else args.Fill = PointColor.MaterialColors[args.Point.Index % 10]; } } else if (NavigationManager.Uri.IndexOf("fabric") > -1) { if (NavigationManager.Uri.IndexOf("dark") > -1) { if (args == null) Theme = Theme.FabricDark; else args.Fill = PointColor.FabricColors[args.Point.Index % 10]; } else { if (args == null) Theme = Theme.Fabric; else args.Fill = PointColor.FabricColors[args.Point.Index % 10]; } } else if (NavigationManager.Uri.IndexOf("bootstrap5") > -1) { if (NavigationManager.Uri.IndexOf("dark") > -1) { if (args == null) Theme = Theme.Bootstrap5Dark; else args.Fill = PointColor.Bootstrap5DarkColors[args.Point.Index % 10]; } else { if (args == null) Theme = Theme.Bootstrap5; else args.Fill = PointColor.Bootstrap5Colors[args.Point.Index % 10]; } } else if (NavigationManager.Uri.IndexOf("fluent") > -1) { if (NavigationManager.Uri.IndexOf("dark") > -1) { if (args == null) Theme = Theme.FluentDark; else args.Fill = PointColor.FluentDarkColors[args.Point.Index % 10]; } else { if (args == null) Theme = Theme.Fluent; else args.Fill = PointColor.FluentColors[args.Point.Index % 10]; } } else if (NavigationManager.Uri.IndexOf("bootstrap4") > -1) { if (args == null) Theme = Theme.Bootstrap4; else args.Fill = PointColor.BootstrapColors[args.Point.Index % 10]; } else if (NavigationManager.Uri.IndexOf("bootstrap") > -1) { if (NavigationManager.Uri.IndexOf("dark") > -1) { if (args == null) Theme = Theme.BootstrapDark; else args.Fill = PointColor.BootstrapColors[args.Point.Index % 10]; } else { if (args == null) Theme = Theme.Bootstrap; else args.Fill = PointColor.BootstrapColors[args.Point.Index % 10]; } } else if (NavigationManager.Uri.IndexOf("tailwind") > -1) { if (NavigationManager.Uri.IndexOf("dark") > -1) { if (args == null) Theme = Theme.TailwindDark; else args.Fill = PointColor.TailwindDarkColors[args.Point.Index % 10]; } else { if (args == null) Theme = Theme.Tailwind; else args.Fill = PointColor.TailwindColors[args.Point.Index % 10]; } } else if (NavigationManager.Uri.IndexOf("highcontrast") > -1) { if (args == null) Theme = Theme.HighContrast; else args.Fill = PointColor.HighContrastColors[args.Point.Index % 10]; } else { if (args == null) Theme = Theme.Bootstrap4; else args.Fill = PointColor.BootstrapColors[args.Point.Index % 10]; } } } |
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/PointRender498643596.zip
Screenshot:
Regards,
Gopalakrishnan Veeraraghavan
- 1 Reply
- 2 Participants
-
JS Joshua Serwatien
- Jul 21, 2023 02:38 PM UTC
- Jul 24, 2023 03:46 PM UTC