Chart options

Posted by: pedro.moraes on 16 September 2024, 2:04 pm EST

  • Posted 16 September 2024, 2:04 pm EST - Updated 16 September 2024, 2:09 pm EST

    Hi everyone,

    I would like to know how the class properties are calculated?

    because my list is getting misaligned. Is there a way to intercept the opening of the list to calculate?

  • Posted 17 September 2024, 5:20 am EST - Updated 17 September 2024, 5:26 am EST

    Hi,

    From my understanding, the chart options dropdown appears misaligned when opened.

    I attempted to replicate this behavior with the available information but was unable to do so. On my end, the chart options dropdown aligns correctly. Please refer to the attached GIF “Steps.gif” and sample.

    Gif:

    Sample: https://jscodemine.mescius.io/share/zup6HsHQr0OvEVeWFYfeRA/?defaultOpen={"OpenedFileName"%3A["%2Findex.html"]%2C"ActiveFile"%3A"%2Findex.html"}

    Regarding how the class properties are calculated, it is handled internally, and there is no public API for manipulating it. However, if you want to intercept the opening of the dropdown to adjust it, you can access the dropdown element and make adjustments as needed as shown in the above gif and sample. Note that this is just a workaround.

    I recommend trying with the latest version (17.1.5) to see if the issue persists. If the problem continues, it could be related to CSS or code within your application. To assist you further, could you provide a sample and steps to replicate the behavior, or modify the existing sample to replicate the issue? Additionally, a GIF or video illustrating the problem would be helpful for further investigation.

    Regards,

    Priyam

  • Posted 17 September 2024, 12:32 pm EST

    Thanks, that was it

    And, How do I remove an option from the graphics side panel?

    For example: Pattern Fill

  • Posted 18 September 2024, 11:26 am EST

    Hi,

    Based on my understanding, you’re looking to remove the Pattern Fill option from the side chart panel.

    You can achieve this by updating the side chart panel template using the registerTemplate method according to your needs. Please refer to the attached snippet and sample below.

    var config = GC.Spread.Sheets.Designer.DefaultConfig;
    config.commandMap = {};
    config.sidePanels.forEach((panel) => {
        if (panel.uiTemplate.toLowerCase().indexOf('chart') !== -1) {
            var template = GC.Spread.Sheets.Designer.getTemplate(panel.uiTemplate);
            removeChartAreaFillPatternFromTemplate(template);
            GC.Spread.Sheets.Designer.registerTemplate(panel.uiTemplate, template);
        }
    });
    
    designer.setConfig(config);

    Sample: https://jscodemine.mescius.io/share/og3_Uhar5UavoCzES0HjuQ/?defaultOpen={"OpenedFileName"%3A["%2Findex.html"%2C"%2Fsrc%2Fapp.js"]%2C"ActiveFile"%3A"%2Fsrc%2Fapp.js"}

    References:

    https://developer.mescius.com/spreadjs/api/designer/modules/GC.Spread.Sheets.Designer#registertemplate

    Best regards,

    Priyam

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels