Opened 11 years ago

Closed 6 years ago

#13503 closed enhancement (patchwelcome)

Data driven labels for chart axes

Reported by: Nick Fenwick Owned by: Eugene Lazutkin
Priority: high Milestone: 1.13
Component: Charting Version: 1.7.0b1
Keywords: charting, labels Cc:
Blocked By: Blocking:


I'm rather new to charting, but there seems no easy way to define an axis as being labelled by the data being plotted. I could have a few concepts twisted in my head, specifically that the axis2d.Default object is the thing that arranges labels (currently via dojox.charting.scaler.linear) and it's distinct from the actual data encapsulated in the Series being plotted.

Eugene confirmed there's no current support for what I am trying to do:

A sandbox example of what I was doing is linked from that post:

Essentially I'd like to see the addAxis call be able to take the data attribute name to use for the label, so in that example my data looks like:

var data = {
        identifier: 'month',
        idAttribute: 'month',
        'label': 'month',
        items: [{
            month: "Apr", total: 100
            month: "May", total: 200
            month: "Jun", total: 150
            month: "Jul", total: 10

When adding the Series called "Low" I am able to say the 'total' attribute should be used for the value at each point.

this.chartC.addSeries("Low", new dojox.charting.StoreSeries(
    store, {
        query: dataQuery
    }, 'total'));

When adding the Axis I would like to be able to say the label should be taken from series "Low"'s 'month' attribute at that point.

For example:

    this.chartC.addAxis("x", {
        natural: true,
        seriesLabels: { series: "Low", attribute: "month" } /* NEW */

From a high level, it seems sensible to be able to label an axis based on data from a named Series's data item attributes. How that will translate into code is another matter :)

Change History (1)

comment:1 Changed 6 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: newclosed

Given that no one has shown interest in creating a patch in the past 4+ years, I'm closing this as patchwelcome.

Note: See TracTickets for help on using tickets.