GithubHelp home page GithubHelp logo

Comments (6)

AAChartModel avatar AAChartModel commented on June 3, 2024

If you want to update AAOptions for AAChartView, you can try this method in the AAChartView.java:

/// A common chart update function
/// (you can update any chart element) to open, close, delete, add, resize, reformat, etc. elements in the chart.
/// Refer to https://api.highcharts.com/highcharts#Chart.update
///
/// It should be noted that when updating the array configuration,
/// for example, when updating configuration attributes including arrays such as xAxis, yAxis, series, etc., the updated data will find existing objects based on id and update them. If no id is configured or passed If the id does not find the corresponding object, the first element of the array is updated. Please refer to this example for details.
///
/// In a responsive configuration, the response of the different rules responsive.rules is actually calling chart.update, and the updated content is configured in chartOptions.
///
/// - Parameter options: A configuration object for the new chart options as defined in the options section of the API.
/// - Parameter redraw: Whether to redraw after updating the chart, the default is true
  public  void aa_updateChartWithOptions(
            Object options,
            Boolean redraw
    ) {
        boolean isAAOptionsClass = options instanceof AAOptions;
        String finalOptionsMapStr;

        if (isAAOptionsClass) {
            String aaOptionsMapStr = new Gson().toJson(options);
            finalOptionsMapStr = aaOptionsMapStr;
        } else {
            String classNameStr = options.getClass().getSimpleName();
            classNameStr = classNameStr.replace("AA","");

            //convert fist character to be lowercase string
            String firstChar = classNameStr.substring(0,1);
            String lowercaseFirstStr = firstChar.toLowerCase();
            classNameStr = classNameStr.substring(1);
            String finalClassName = lowercaseFirstStr + classNameStr;

            Map<String, Object> finalOptionsMap = new HashMap();
            finalOptionsMap.put(finalClassName,options);

            String optionsStr = new Gson().toJson(finalOptionsMap);
            finalOptionsMapStr = optionsStr;
        }

        String javaScriptStr = "updateChart('" + finalOptionsMapStr + "','" + redraw + "')";
        this.safeEvaluateJavaScriptString(javaScriptStr);
    }

you can find some usage samples in the AAChartCore-Kotlin demo.

Refer to the API doc online:

from aachartcore-kotlin.

IrvanWijayaSardam avatar IrvanWijayaSardam commented on June 3, 2024

what's the version that you use ? because in version com.github.AAChartModel:AAChartCore-Kotlin:7.1.0 , the function still like this

image

from aachartcore-kotlin.

AAChartModel avatar AAChartModel commented on June 3, 2024

Apologies for the mistake, the code snippet I shared is from the Java version of AAChartCore library.

from aachartcore-kotlin.

AAChartModel avatar AAChartModel commented on June 3, 2024

In any case, these two codes functionally serve the same purpose, they merely differ in terms of language version.

from aachartcore-kotlin.

IrvanWijayaSardam avatar IrvanWijayaSardam commented on June 3, 2024

i've change the version from 7.1.0 to 7.2.0, and the function aa_updateChartWithOptions seems working
image
i think there's some change in the function, but i have new issues , why the dataLabelsEnabled is still visible when i set to false ? and the tooltip is not showing, like the new aaChartModel not applied anything

image

this is how do i apply it for the first time
image

from aachartcore-kotlin.

IrvanWijayaSardam avatar IrvanWijayaSardam commented on June 3, 2024

in the config i set the tooltip to enabled, but the tooltip javascript now showing
image

from aachartcore-kotlin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.