Categories re-arrange with OWC11

W

waynehirata

I'm using OWC11 Charting Component. I have several lines charted.

series.SetData c.chDimCategories, c.chDataLiteral, strCats1
series.SetData c.chDimValues, c.chDataLiteral, strVals1
....series.add...
series.SetData c.chDimCategories, c.chDataLiteral, strCats2
series.SetData c.chDimValues, c.chDataLiteral, strVals2

strCats1 is an string array with the categories. They are in the order
I would like them to appear.

strCats2 is an array with a subset of the categories in strCats1, but
still in the correct order. And the same with strCats3, strCats4.

My graph is displayed with the categories in a random order, to me it
seems random.

Is there a way to display the categories in a order I specify? I am use
client-side vb scripting. columnClustered display in the correct order.
But not lineMarkers.

Thank you for any help.
 
W

waynehirata

Ok, I have some clues. Sometimes when you set the SeriesType, the
series' index in the SeriesCollection will change, so the first series
may become the last series. If I manage to keep the first series at
index zero, then my chart is nice. What, where, when, how you set the
various properties will mess you up.

Another thing I have discovered is do not use:

for i=0 to SeriesCollection.Count-1 '//bad

Instead you should use

For Each x in SeriesCollection

Anyway, this Office Web Component is buggy, buggy, bugged. And don't
get me started on the weirdness when using a recordset for the
datasource. (TimeAxis disappear, categories auto-sort, nulls reek
havoc)
 
W

waynehirata

I'm replying to myself.
Do not assign the SeriesType more than once. If you do, the series
index will change. The chart will start using the categories from index
zero to build the categories. So if the indexes change, you may get
unexpected behavior.
Good luck, self.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top