0

I'm using json.net to build and push a highchart to a Geckoboard. Geckoboard doesn't give any example to set the lang options (even if they did I don't exaclty know where I would set them). I know there is custom formatting, but I receive a 400 bad request when I try to pass in a Javascript function to format:

            new JProperty("yAxis",
                new JArray(
                    new JObject(
                        new JProperty("title",
                            new JObject(
                                new JProperty("style",
                                    new JObject(
                                        new JProperty("color", "#b9bbbb")
                                    )
                                ),
                                new JProperty("text", "Sales Orders")
                            )
                        ),
                        new JProperty("labels",
                            new JObject(
                                new JProperty("formatter",new JRaw("function(){return this.value/100;}"))
                            )
                        )
                    ),
                    new JObject(
                        new JProperty("title",
                            new JObject(
                                new JProperty("text","Ad Cost"),
                                new JProperty("style",
                                    new JObject(
                                        new JProperty("color","#FFFFFF")
                                    )
                                )
                            )
                        ),
                        new JProperty("opposite","true")


                    )
                 )

            ),

This is based of the jsfiddle provided by Highcharts: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/xaxis/labels-formatter-linked/

The relevant part of the string that I am posting to Geckoboard:

      "yAxis": [
    {
      "title": {
        "style": {
          "color": "#b9bbbb"
        },
        "text": "Name Of Axis"
      },
      "labels": {
        "formatter": function(){return this.value/100;}
      }
    },

Any help would be greatly appreciated.

Noah Hall-Potvin
  • 187
  • 1
  • 10
  • Just from testing your [fiddle](http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/xaxis/labels-formatter-linked/) a little, you shouldn't have the array bracket around the `"yAxis"` contents. It should be `"yAxis": { ... }` not `"yAxis": [{ ... }]` – dbc Jul 24 '15 at 18:08
  • Can you show the code that creates the `JObject` corresponding to the entire `"yAxis"`? – dbc Jul 24 '15 at 18:13
  • I have added the full code involving the yAxis. I don't know if Geckoboard supports js functions – Noah Hall-Potvin Jul 24 '15 at 18:40

1 Answers1

0

Geckoboard responded to my inquiry (submitted a help ticket) and they said that they don't support this implementation at this time.

Noah Hall-Potvin
  • 187
  • 1
  • 10