Error: Stacked Bar series may not have two datapoints with the same yValue


#1

I am trying to make a stacked bar chart and I am following the BarChart demo code as a source. I am using three series in my case where in the demo they used two. This may be unrelated but, do I need to offset the stackIndex for each key or something? In the demo they set series.stackIndex to 1. Do I need something else since I have three keys/series and they have two?

I do not repeate a yValue inside of a series. Here are the datapoints I am creating:

DetailChartDataSource Datasource: dataPointAtIndex Series: 0 yValue:Pre-Breakfast xValue:0
 DetailChartDataSource Datasource: dataPointAtIndex Series: 0 yValue:Pre-Lunch xValue:0
 DetailChartDataSource Datasource: dataPointAtIndex Series: 0 yValue:Pre-Dinner xValue:0
 DetailChartDataSource Datasource: dataPointAtIndex Series: 0 yValue:Post-Dinner xValue:0
 DetailChartDataSource Datasource: dataPointAtIndex Series: 0 yValue:Night xValue:8.540166
 
 DetailChartDataSource Datasource: dataPointAtIndex Series: 1 yValue:Pre-Breakfast xValue:69.1579
 DetailChartDataSource Datasource: dataPointAtIndex Series: 1 yValue:Pre-Lunch xValue:71.625
 DetailChartDataSource Datasource: dataPointAtIndex Series: 1 yValue:Pre-Dinner xValue:30.87603
 DetailChartDataSource Datasource: dataPointAtIndex Series: 1 yValue:Post-Dinner xValue:69
 DetailChartDataSource Datasource: dataPointAtIndex Series: 1 yValue:Night xValue:42.70083
 
 DetailChartDataSource Datasource: dataPointAtIndex Series: 2 yValue:Pre-Breakfast xValue:76.84211
 DetailChartDataSource Datasource: dataPointAtIndex Series: 2 yValue:Pre-Lunch xValue:71.625
 DetailChartDataSource Datasource: dataPointAtIndex Series: 2 yValue:Pre-Dinner xValue:138.9421
 DetailChartDataSource Datasource: dataPointAtIndex Series: 2 yValue:Post-Dinner xValue:69
 DetailChartDataSource Datasource: dataPointAtIndex Series: 2 yValue:Night xValue:111.0222
 
 I am getting this Error:

Error: Stacked Bar series may not have two datapoints with the same yValue

From: <SChartBarSeries: 0x2003d0f0>


#2

Hi DragonSightSoftware,

I tried to replicate the issue you’re having by using the bar chart example and plugging in the data you referenced. However, my application didn’t throw any errors and displayed the chart shown in the image below:

Is that the type of chart you were looking for?

If so, check you have the latest version of Shinobi Charts and if your problem still persists can you send me a link where I can download a cut down version of your chart.

If not, can you explain what chart you’re after, perhaps with a screenshot?

Kind Regards,

Andrew Polkinghorn


#3

Thanks Andrew. I am trying to make a stacked bar chart simular to what you just did. One diffrence is that I am feeding it from data I pulled from coredata and then summed up. This is also the second chart on the same screen. Both charts use diffrent datasources. The first chart is a line chart that runs no problem when the detail bar chart is not being displayed. 

Thanks for showing me its not the data but something else I am doing. I am going to go through things once again and try some more tests and get back to you. 


#4

I found my problem… I had originally was going to do a diffrent chart and had set the axis type to a catagory axis. When I chaged it to a number axis things worked… I hope that helps someone else if they run into the same type of issue.

Thanks again Andrew for your help.


#5

I’m getting this same message: “Error: Stacked Column series may not have two datapoints with the same xValue”

What I’ve got is a column chart (vertical bars) with 4 series, which I’d like stacked.  So the columns would look something like this:

D
D  D     D 
D  C  C  D …
D  C  C  B
C  B  C  B
C  B  B  B
B  B  A  B
B  A  A  B
B  A  A  A
A  A  A  A
A  A  A  A

As you can see, in Column 3, the D value is 0 and, in column 4, the C value is 0.  Also, in several places, the column values are the same, because that’s what the data is!

So, how do I get around this error message?  It seems silly that I can’t display my columns to reflect my data; I’m certain that I must just have a bad configuration, rather than this being an actual limitation of Shinobi.

I’ve got Shinobi Charts v2.2.0 (according to Version.txt that came with.)  Also – it’s quite a PITA on this site to find (a) what is the latest version and (b) where to download again without signing up for a new trial membership.  I’m trying to convince my client that this is a great package that they should purchase, but you guys aren’t helping, any!

(Other than that, I like it a lot. :slight_smile:

Thanks!

 EDIT: In every series, the X-value is the title of the column (which, in this case, is the date-label for the data.)  Is maybe that my problem?  How can my stacked-columns =NOT= have the same X-value?!?!
 
EDIT #2: Ok, and that was the clue.  I had my X & Y values reversed in my data source.  Once I fixed that, all is good.
 
"Nevermind...!"  :)

#6

Hi Chum,

I’m glad you solved your problem. 

Regarding the following two comments you made:

(a) what is the latest version and (b) where to download again without signing up for a new trial membership.

Do you have any ideas or suggestions on how to fix these issues and improve our site?

As we care about what users of the site think and any feedback is appreciated.

Kind regards,
Andrew Polkinghorn


#7

Suggestions:

a) Add “Latest version of SinobiCharts is: x.y.z” message at near the top of the developer page.  Maybe right under “Welcome to Shinobi Developer.  The latest versions are… Charts: x.y.z, Grids: x’.y’.z’, Essentials: x”.y".z" or something similar.  The actual text/placement is less important than that it exist at all.  I’m sure your web-design person has a good eye for this stuff, and I trust tha they can make it nice.  :)

b) Put a DOWNLOAD LATEST VERSION link prominantly either on the main page (http://www.shinobicontrols.com) or on the developer page (http://www.shinobicontrols.com/shinobideveloper/)  From my POV, best would be on the dev page, right up top, along side “Charts Grids Essentials Suite”.

Not as good for me (more steps to click), but I could see why you might want to do it this way:  on the “30 DAY FREE TRIAL” page, add link for “I already have my trial, just want to re-download the latest.”

I don’t know, but I’m assuming that, once we get a full license and can login to the CUSTOMER PORTAL, there is a “DOWNLOAD LATEST VERSION (x.y.z)” link somewhere easy to find.  If not, it should be there, of course.

The reason all this matters is because, as  someone new to Shinobi, I spend a fair bit of time looking through the forums for answers to n00b questions.  A lot of the answers contain a part that says “make sure that you have the latest version of Shinobi[charts] installed…”  Currently, the only way I can check my version is to look at the Version.txt that came with my download, but there’s no obvious way to either find out if that’s still the latest or to download again to make sure I have the latest.

(If such things exist and I’m just not seeing them, then that’s a problem, too.  To a developer, “What’s the latest version” and “where do I go to dowload the latest version” are VERY common items!)

Thanks!


#8

Hi Chum,

Thanks for your feedback on our site! Your suggestions have been forwarded to our web development team.

To answer your question about the Customer Portal, Yes! There is a page that lists all of the releases available to download each clearly stating their version number. 

Kind Regards,
Andrew Polkinghorn.


#9

Hi so since we are talking about stacked bar charts, me I would like to click on the x, y item and open a page. I have tried subclassing the ShinobiChart and putting code in the TouchesEnded override this fires but how do I get seriesindex  or x y of chart not as a point but say the index 0 x  or title x and index 2 or title y thanks I also tried using delegate for OnToggleSelection but this doesnt seem to fire all time Thanks Matt