19484

Add additional data to tooltip in iOS which does not belongs to x&y-axis of graph

Question:

I followed this demo to draw Column charts. (<a href="https://www.highcharts.com/ios/demo/column-rotated-labels" rel="nofollow">https://www.highcharts.com/ios/demo/column-rotated-labels</a>).

What Issue I am facing is : I can easily show x-axis and y-axis information in tooltip. But I am not able to put additional information in tooltip from a different array (suppose array for depicting required qty for item).

I tried to do like this ;

tooltip.pointFormat = [NSString stringWithFormat:@"Velocity : {point.y:.2f} Remaining Quantity : %@",RemainingQtyArray]; It will print whole array in tooltip. tooltip.pointFormat = [NSString stringWithFormat:@"Velocity : {point.y:.2f} Remaining Quantity : %@",RemainingQtyArray[i++]]; It will print last item from array. So, how can i put additional info so that when anyone taps on graph, it will show this info too.

<a href="https://i.stack.imgur.com/m6vw4.png" rel="nofollow"><img alt="" class="b-lazy" data-src="https://i.stack.imgur.com/m6vw4.png" data-original="https://i.stack.imgur.com/m6vw4.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" /></a> <strong>Want tooltip like this.</strong>

Answer1:

Check this <a href="http://jsfiddle.net/0sarjr1d/1" rel="nofollow">Fiddle</a> demo in JS

Tooltip in JS way

tooltip: { pointFormat: 'Population in 2017: <b>{point.y:.1f} millions</b><br>Extra One: <b>{point.data1}</b><br>Extra Two: <b>{point.data2}</b>' },

Series data in JS way

data: [ {name:'Shanghai', y:24.2,data1:'Aa',data2:'Ba'}, {name:'Beijing', y:20.2,data1:'Ab',data2:'Bb'}, {name:'Karachi', y:14.2,data1:'Ac',data2:'Bc'}, {name:'Shenzhen', y:13.2,data1:'Ad',data2:'Bd'}, ],

Through <a href="https://www.highcharts.com/ios/demo/column-rotated-labels" rel="nofollow">doc</a> I convert into ios.

For ios

HITooltip *tooltip = [[HITooltip alloc]init]; tooltip.pointFormat = @"Population in 2017: <b>{point.y:.1f} millions</b><br>Extra One: {point.data1}<br>Extra Two: {point.data2}";

For ios series data

column.data = [NSMutableArray arrayWithObjects: @{ @"name":@"Shanghai", @"y":@23.7, @"data1":@'Aa', @"data2":@'Ba' }, @{ @"name":@"Shanghai", @"y":@16.1, @"data1":@'Aa', @"data2":@'Ba' }, @{ @"name":@"Karachi", @"y":@14.2, @"data1":@'Aa', @"data2":@'Ba' }, @{ @"name":@"Shenzhen", @"y":@14, @"data1":@'Aa', @"data2":@'Ba' } , nil];

Recommend

  • Overlaying or merging multiple .ps files
  • How can I put custom color in High Charts PIE data | Slice and want to change slice text
  • Insert multiple row using the same MySQL connection?
  • CMCalibratedMagneticField doesn't update
  • “tkinter.TclError: invalid command name” error after calling root.destroy()
  • All bodies have rigidbody 2d and boxcollider2d and there's no collision
  • NSURL Always Returns Nil
  • Display Local HTML file from documents directory in a UIWebView on iPhone
  • LibGDX Multiply Vector2 with float value
  • adding zeros in objective-c string formats
  • Post comment to WordPress Blog from iPhone programmatically
  • Creating interactive SVG maps for a web portal
  • iOS Date formatting
  • Single virtual attribute definition for multiple fields
  • Google Player Game Service Error: Can't build the sample game
  • Titanium doesn't recognize Android SDK on Windows
  • Yii2 Login with database
  • Submit a form with jQuery / Javascript without ignoring “required” tag
  • Granting permissions to Azure Active Directory Web Application automatically
  • Many to Many in Linq using Dapper
  • Backward compatibility of Python 3.5 for external modules
  • How to validate a year I enter in textbox using jquery rule?
  • What is this iOS exception with NSCFType?
  • Laravel at least one field is required
  • LiveData is abstract android
  • how to solve invalid conversion specifier warning in iphone app
  • Sensibility of combined Maven/Ant+Ivy build management for dual platform Desktop/Android deployment?
  • Validate child input components on submit with Vee-Validate and vue js 2
  • as3-flash: any way to access all the instances placed in different frames from document class?
  • Does Mobilefirst provide a provision to access web services directly?
  • Does it make sense to call System.gc() and Thread.sleep() when working on Bitmaps?
  • Caching attributes in superclass
  • Android screen density dpi vs ppi
  • java.lang.NoClassDefFoundError: com.parse.Parse$Configuration$Builder on below Lollipop versions
  • How would I use PHP exceptions to define a redirect?
  • How to extract text from Word files using C#?
  • Compare two NSDates in iPhone
  • Codeigniter doesn't let me update entry, because some fields must be unique
  • need help with bizarre java.net.HttpURLConnection behavior
  • Does armcc optimizes non-volatile variables with -O0?