Format currency in tooltip #200

Open
jtlindsey opened this Issue Aug 20, 2015 · 3 comments

Projects

None yet

3 participants

@jtlindsey

Hello,

I'm using a column chart with rails and managed to get currency working on the y axis, but not in the tool tip.
screen shot 2015-08-19 at 8 00 20 pm

Here is my original code in helper.rb

  def networth_data
    [
      {name: "Assets", data: {"NetWorth": Account.assets(current_user)}}, 
      {name: "Liabilities", data: {"NetWorth": Account.liabilities(current_user)}}
    ]
  end

And in view

<%= column_chart networth_data, colors: ["green", "#FF0000"], library: {pointSize: 0, vAxis:  {format: "currency"}, backgroundColor: "#FFF", height: 265} %>

screen shot 2015-08-19 at 7 58 08 pm

Im not sure what to change to get the tooltip displaying the currency instead of raw number. Is there a way to change this?

@jjahaziel

I have the same problem

@jtlindsey

I ended up turning the tooltip off. See example.

<%= column_chart networth_data, colors: ["green", "#FF0000"], library: {pointSize: 0, vAxis:  {format: "currency"}, legend: { position: 'none'}, backgroundColor: "#FFF", height: 265} %>
@ankane ankane added the enhancement label Jan 7, 2017
@ankane
Owner
ankane commented Jan 7, 2017

It'd be great to have a prefix option for this (and a suffix one for things like percentages).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment