How Do You Get Tooltips in Open Flash Charts When Writing JSON?

577 views Asked by At

I am trying to display a chart with tool tips but I cannot seem to figure out how you put in tool tips when you write your own JSON for the chart.

Is this possible?

Here is the JSON I have written so far:

var days_of_week_chart = {
  "elements": [
    {
      "type": "bar",
      "values": [33,0,0,0,0,0,0,],
    }
  ],
  "title": {
    "text": "Visitors By Day of Week"
  },
  "x_axis":{
    "stroke":1,
    "tick_height":10,
    "colour":"#d000d0",
    "grid_colour":"#00ff00",
    "labels": {
        "labels": ["Saturday","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday",]
    }
   },
    "y_axis": {
        "stroke": 4,
        "steps": 5,
        "tick_length": 5,
        "colour": "#d000d0",
        "grid_colour": "#00ff00",
        "offset":  0,
        "max": 33   }
};
1

There are 1 answers

0
Evan R. On BEST ANSWER

You need to have the tooltip element, and tip element in the data series:

{ "elements": [ { "type": "hbar", "values": [ { "right": 4 }, { "right": 8 }, { "right": 3 }, { "right": 4 }, { "right": 7 }, { "right": 8 } ], "colour": "#86BBEF", "tip": "Months: #val#" } ], "title": { "text": "Total hours on project mayhem" }, "x_axis": { "offset": false, "min": 0, "max": 10 }, "y_axis": { "offset": 1, "labels": [ "Jeff", "Geoff", "Bob", "Terry", "Duncan", "monk.e.boy" ] }, "tooltip": { "mouse": 2, "stroke": 1, "colour": "#000000", "background": "#ffffff" } }