highcharts / highcharts-ios

iOS wrapper for Highcharts.
Other
127 stars 39 forks source link

Using highcharts-regression plugin in iOS highchart #437

Closed sagar-kudale30 closed 5 months ago

sagar-kudale30 commented 6 months ago

Is there a way to use Highchart-regression (https://www.npmjs.com/package/highcharts-regression) in iOS through plugin.

We want to show linear regression series with scatter chart.

MikolajMichalczak commented 6 months ago

Hi @sagar-kudale30! Here is a demo of a scatter plot with a regression line on iOS: https://www.highcharts.com/demo/ios/combo-regression. There is no way to use custom plugins at the moment.

sagar-kudale30 commented 6 months ago

Hey @MikolajMichalczak Thanks for the reply and demo link.

We are using JSON to load charts via loadJSONOptions method so it will not help us in our case.

MikolajMichalczak commented 6 months ago

I recreated this chart with the use of loadJSONOptions method:

let options = [
  "series": [
    [
      "type": "line",
      "data": [[0, 1.11], [5, 4.51]]
    ] as [String: Any],
    [
      "type": "scatter",
      "data": [1, 1.5, 2.8, 3.5, 3.9, 4.2]
    ] as [String: Any]
  ],
  "title": [
    "text": "Demo chart"
  ],
  "chart": [
    "type":"column",
    "renderTo":"container"
  ]
] as [String: Any]

chart.loadJSONOptions(options)

Unfortunately, you have to calculate line series data by yourself according to your scatter data.

MikolajMichalczak commented 6 months ago

@sagar-kudale30 Can i close this issue?

sagar-kudale30 commented 6 months ago

Hey @MikolajMichalczak This will not help us as we don't want to do line series calculation ourself. We are displaying same chart on web as well with the help on Highchats-regression.
Do we have any plan to add native support for linear regression or Plugin for same in near future for iOS?

MikolajMichalczak commented 6 months ago

@sagar-kudale30 Unfortunately, there are currently no options or plans to support the use of custom plugins, including regression, either on Android or iOS.