vikas7406
Posts: 1
Joined: Wed May 24, 2023 12:28 pm

multiple internal drill down with different datatype y axis formatter

Hi highchart team
I am using Swift 5 and Highchart 10.3.3 

On click of drill down event, I want to update the y-axis data type as dynamic data types like currency, percentage, string and numeric etc 

In one chart there is a nested drill-down chart available 

example expectation - the first chart with y-axis formatted percentage has a drill-down chart on click of drill down chart second chart appears. in that second chart, I want y axis datatype will be a dollar, there is a second drill-down chart available click the second drill-down chart the third chart will appear with another data type like numeric .it will go up to n number of inner charts and drill-down charts.

what i am getting from the below code - every y axis data fromatter is same
 

  var chartDataDictionary: [String: Any] = [:]

this is my parent chart array of dictionary  dictionary 

 

  var drillDownSeries: [String: Any] = [:]

this is drill down chart series dictionary 

 

 if drillDownSeries.keys.count > 0, let jsonData = try? JSONSerialization.data(withJSONObject: drillDownSeries, options: []),

      let jsonString = String(data: jsonData, encoding: .utf8) {

      let escapedSingleQuoteString = jsonString.replacingOccurrences(of: "\'", with: "`")

      let drillDownJsonString = escapedSingleQuoteString.replacingOccurrences(of: "\"", with: "'")

        let jsfunction = " function(e) { if (!e.seriesOptions) { var chart = this, drilldowns = \(drillDownJsonString); e.point.drilldownTo.forEach(function (d) { chart.addSingleSeriesAsDrilldown(e.point, drilldowns[d]); }); chart.applyDrilldown(); } }"

        chartDataDictionary.setValue(value: HIFunction(jsFunction: jsfunction), forKeyPath: "chart.events.drilldown")

    }

    chartDataDictionary.setValue(value: 0, forKeyPath: "plotOptions.series.animation.duration")

 thanks in advance
jakub.j
Posts: 1091
Joined: Tue Jan 24, 2023 11:14 am

Re: multiple internal drill down with different datatype y axis formatter

Welcome to our forum and thanks for contacting us with your question!

I can see that this is a duplicate post from our forum.

We work as a single team across all support platforms. Please do not duplicate your topics because it only disrupts our work. You do not have to worry because we always answer all questions on our support platforms.

Best regards
Jakub

Return to “Highcharts Usage”