Open Closed

After Upgrading to Abp Commercial V5.2, ChartjsStyleContributor is not recognized #2923


User avatar
0
piseth created
  • ABP Framework version: v5.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

5 Answer(s)
  • User Avatar
    0
    piseth created

    Within my lower version < 5.2, ChartjsStyleContributor is recognized and working fine. it is from Volo.Abp.AspNetCore.Mvc.UI.Packages.ChartJs.ChartjsStyleContributor I use it in my class MyChartViewComponent.cs under MyProject.Web.Pages.Shared.Components.MyCharts.MyChartWidget

    ****Now it is not recognized

    namespace MyProject.Web.Pages.Shared.Components.MyCharts.MyChartWidget
    {
    [Widget(
        StyleTypes = new[] { typeof(ChartjsStyleContributor) },
        ScriptTypes = new[] { typeof(MyChartWidgetWidgetScriptContributor) }
        )]
    public class MyChartViewComponent : AbpViewComponent
    {
        public virtual IViewComponentResult Invoke()
        {
            return View("/Pages/Shared/Components/MyCharts/MyChartWidget/Default.cshtml");
        }
    }
    
    [DependsOn(typeof(ChartjsScriptContributor))]
    public class MyChartWidgetWidgetScriptContributor : BundleContributor
    {
        public override void ConfigureBundle(BundleConfigurationContext context)
        {
            context.Files.Add("/Pages/Shared/Components/MyCharts/MyChartWidget/Default.js");
        }
    }
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    piseth created

    any update plz?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    HI,

    We have upgrade Chartjs to version 3.7.0, no longer needs style.

    See: https://github.com/abpframework/abp/pull/11861

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    piseth created

    https://github.com/abpframework/abp/pull/11861

    So how my code should look like?

    it works like the following?

    namespace MyProject.Web.Pages.Shared.Components.MyCharts.MyChartWidget
    {
    [Widget(
      
        ScriptTypes = new[] { typeof(MyChartWidgetWidgetScriptContributor) }
        )]
    public class MyChartViewComponent : AbpViewComponent
    {
        public virtual IViewComponentResult Invoke()
        {
            return View("/Pages/Shared/Components/MyCharts/MyChartWidget/Default.cshtml");
        }
    }
    
    
    public class MyChartWidgetWidgetScriptContributor : BundleContributor
    {
        public override void ConfigureBundle(BundleConfigurationContext context)
        {
            context.Files.Add("/Pages/Shared/Components/MyCharts/MyChartWidget/Default.js");
        }
    }
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    Just remove ChartjsStyleContributor, it should be work.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.