chart for data like ["0", "1", "0", "1", "1", "0".....]

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
vrsarav
Posts: 16
Joined: Mon Nov 09, 2009 4:34 pm
antibot: No, of course not.

chart for data like ["0", "1", "0", "1", "1", "0".....]

Post by vrsarav » Mon Nov 09, 2009 5:44 pm

Hi All,
Good to be part of this forum.Congratulations for coming up with such a wonderful library. I'm extremely happy with this one.

Query:
I have an array of data with binary values of 0s and 1s. I would like to plot these set of values. I wanted to plot when value is 1 and nothing when value is 0.
Something, Similar to the following graph, a line drawn indicates value of 1 and empty space indicates 0.

|____________ _______ _____ ________
|
|
|
|_______________________________________________

for the values like
1111111111110000111111101111101111111

I'm not sure whether i'm making myself clear. If you need more info i could try attaching a sample jpg. It'll be great if someone could give suggestions.

Thanks.

remiohead
Posts: 201
Joined: Fri Oct 02, 2009 3:53 pm
antibot: No, of course not.

Re: chart for data like ["0", "1", "0", "1", "1", "0".....]

Post by remiohead » Mon Nov 09, 2009 5:47 pm

Use null for the 0 data point.

vrsarav
Posts: 16
Joined: Mon Nov 09, 2009 4:34 pm
antibot: No, of course not.

Re: chart for data like ["0", "1", "0", "1", "1", "0".....]

Post by vrsarav » Mon Nov 09, 2009 7:44 pm

Thanks remiohead.
But i'm not sure as to what type of chart should i use and how do i represent Domain axis and Range axis.

Because i have only these values of 0s and 1s. I'm not sure what do i plot against? This data is not based on any timeline too. These are just available samples. SO i don't think i can have date axis too.

Any suggestions?

vrsarav
Posts: 16
Joined: Mon Nov 09, 2009 4:34 pm
antibot: No, of course not.

Re: chart for data like ["0", "1", "0", "1", "1", "0".....] img

Post by vrsarav » Mon Nov 09, 2009 8:42 pm

Actually I'm not sure i have explained my self pretty clear. I have attached an image that would explain what i'm looking for.
Image

I cannot use dateAxis as the data i have is nothing to do with time. Any suggestions as to what kind of chart should i go for?
For example, On one axis i could have categories and what should i have on the other axis? Even if i have total number of values on the other axis for eg. running from 0 to 1000 (array length) how would i plot all 0s and 1s in this chart.

Probably i'm confused and any suggestions are appreciated.

Thanks.

vrsarav
Posts: 16
Joined: Mon Nov 09, 2009 4:34 pm
antibot: No, of course not.

Re: chart for data like ["0", "1", "0", "1", "1", "0".....]

Post by vrsarav » Tue Nov 10, 2009 3:01 pm

I think i'm going to use symbol axis with a XYPlot for this. Thanks for the help guys.

Locked