Sign in to follow this  
nickpdx

Multi-series chart with unrelated categories?

Recommended Posts

The data I want to chart is structured like so:

 

 

 

Top 5 Alpha Widgets:

 

foo, 12

 

bar, 20

 

baz, 49

 

fox, 31

 

bop, 88

 

 

 

Top 5 Beta Widgets:

 

foo, 99

 

baz, 7

 

nut, 29

 

 

 

I thought I'd like to chart this on 1 chart with 2 categories, Alpha and Beta. The problem is obviously that the 2 data series don't share exactly the same labels. All the examples I've found for multi-series charts seem to mandate that all dataseries correlate with each other exactly, and that they contain exactly as many elements as there are categories for the chart.

 

 

 

What type of chart should I use to display this data? It seems like I can't use the one I would like, multi-series 3D column, because the data doesn't fit into its allowed format.

 

 

 

I could put both data series in a single-series chart with a spacer in between. But in that case, I would like to color all the Alphas together, color all the Betas together, and show a legend with Alpha and Beta next to their colors. However I can't find an example for adding a legend to a single-series chart.

Share this post


Link to post
Share on other sites

What you can do is create a category list indicating the union of all data - like foo, bar, etc1, etc2.

Now, in alpha dataset, provide <set value='xx' /> for those categories which have data and <set /> for those which do not have. Do the same in beta too.

Share this post


Link to post
Share on other sites

Thanks for the suggestion, it does enable the data to be charted. But not in quite the way I'd like.

 

 

 

The multi-series charts by default organize the categories' data all together. What I would like is for the chart to be rendered with the columns for Alpha on the left, all colored red; the columns for Beta on the right, all colored green; labels on the x-axis for all columns; and a legend indicating that red is for Alpha, and green is for Beta.

 

 

 

Put another way, take the output from your suggested multi-series column chart, and push all same-colored columns to one side. The category labels would essentially be repeated twice _if_ it has a value in both Alpha and Beta set.

 

 

 

What I want is really more like a single-series chart where I set the same color on all the associated elements. But I don't see a way to add a legend to a single-series chart.

 

 

 

Maybe my question is better asked this way: how can I add a legend to any type of chart? If that's not possible, I would have to ask why. It seems like adding a legend is absolutely necessary the second you begin manually setting colors for elements.

Share this post


Link to post
Share on other sites

You can do this:

1. Use 2 single-series or 1 multi-series chart to show the data.

2. Use our grid component to show the legend.

Share this post


Link to post
Share on other sites

So there's no way to add a legend to the outer-canvas of any chart?

 

 

 

Is that something you could maybe put down as a future improvement? It would seem to be a solidly valuable addition to any type of chart.

 


<chart>

<set color="FF0000" ..... />

<set color="00FF00" ..... />

<legend>

   <item color="FF0000" label="Alpha"/>

   <item color="00FF00" label="Beta"/>

</legend>

</chart>

Edited by Guest

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this