Jump to content
Software FX Community

Passing Data to XChart


User (Legacy)

Recommended Posts

Hi All,

I'm passing data read from a database to a XChart with a VB.NET code like

this:

Dim nX As Integer

StatisticsX = New Statistics

StatisticsX.Chart = Chart2

Chart2.OpenData(COD.Values, 1, rst.Tables(0).Rows.Count)

'Add a point for each sereis to the right of the chart

'Using the legend property, set the legend values

For nX = 0 To rst.Tables(0).Rows.Count - 1

Chart2.Value(0, nX) = rst.Tables(0).Rows(nX)("Value")

Next nX

Chart2.CloseData(COD.Values)

Chart2.GalleryObj = StatisticsX.Gallery.XChart

StatisticsX.LegendBox = True

StatisticsX.LegendBoxObj.SizeToFit()

'Set Limit's

StatisticsX.Calculators(0).Lsl = rst.Tables(0).Rows(0)("LSL")

StatisticsX.Calculators(0).Usl = rst.Tables(0).Rows(0)("USL")

Now I've two problem:

1. How to access to the LCL and UCL value

2. The dataeditor and the chart work only on 1 value but my DB Table have

more data (nearly 100 value but I've tryed also with only 2 or 3 and It

seems it makes a average of all the data value I pass).

Please Help me.

Dario

Link to comment
Share on other sites

I think we fail to explain this in the docs.

An x-chart takes a set m of series, each series represents a set of n

measures.

The resulting x-chart is a chart with m points, where each point is the

average (x-bar) of the n measures for that point.

For example, the following dataset (each column being a series):

157.76 172.89 179.18 152.22 174.40 153.42 67.00 163.44 175.33 160.28 164.07

171.33 161.88 161.43 178.95 151.97 156.69 171.71 43.00 161.23 170.08 166.04

158.73 42.00 151.60 151.52 31.00 160.85 155.57 151.36 153.55 170.18 166.74

157.50 168.66 145.99 157.02 167.71 219.00 165.78 159.45 157.78 161.03 172.20

179.97 154.89 168.94 164.86 149.31 170.18

164.27 172.18 180.54 160.73 63.00 159.13 152.69 159.98 175.10 166.21 167.33

181.68 2.00 165.16 186.49 73.00 164.77 172.91 166.15 163.73 172.56 172.65

164.56 169.31 163.39 164.55 167.87 168.50 172.19 166.35 166.24 169.25 172.18

164.17 171.27 271.00 163.62 173.74 180.85 179.21 172.67 172.92 170.49 172.94

188.32 174.83 178.25 187.25 0.00 179.90

167.74 177.38 174.77 157.17 172.35 162.69 163.17 165.43 175.33 166.01 173.22

182.28 170.41 180.22 62.00 161.20 172.89 183.24 169.37 171.57 172.39 183.84

172.97 179.68 176.17 175.68 171.61 174.59 184.70 91.00 168.34 176.10 184.19

3.00 177.84 167.87 177.05 187.35 190.00 191.48 184.47 191.07 174.76 180.36

187.76 183.71 179.12 189.91 184.62 186.91

Will produce an x_bar chart with the following values:

163.26

174.15

178.17

156.71

136.58

158.41

127.62

162.95

175.26

164.17

168.20

178.43

111.43

168.94

142.48

128.72

164.78

175.95

126.17

165.51

171.68

174.17

165.42

130.33

163.72

163.92

123.50

167.98

170.82

136.24

162.71

171.84

174.37

108.23

172.59

194.95

165.89

176.27

196.62

178.83

172.20

173.92

168.76

175.17

185.35

171.14

175.44

180.67

111.31

178.99

The x-chart contains only one series. Then the control limits are calculated

based on this new data.

I don't understand very well where your data is coming from but it seems

that you have only one measurement for each sample, in this case, you must

"transpose" the way you are passing the data, creating a chart with n series

and one(1) point. Something like this:

Chart2.OpenData(COD.Values, rst.Tables(0).Rows.Count, 1)

'Add a point for each sereis to the right of the chart

'Using the legend property, set the legend values

For nX = 0 To rst.Tables(0).Rows.Count - 1

Chart2.Value(nX,0) = rst.Tables(0).Rows(nX)("Value")

Next nX

Chart2.CloseData(COD.Values)

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Hi,

OK, I've understand.

Can You also answer my second question about the way to pass to the

statistical extension the value of the UCL and LCL ? The the USL and LSL

there's no problem but for It I don't have a "Link" to find the study but I

need to loop on the collection and when I find the name change the value. Is

this one the only method or I miss something ?

Thank you in advance

Dario

"SoftwareFX Support" <support@softwarefx.com> ha scritto nel messaggio

news:pQqUX3G4DHA.2468@webserver3.softwarefx.com...

> I think we fail to explain this in the docs.

>

> An x-chart takes a set m of series, each series represents a set of n

> measures.

>

> The resulting x-chart is a chart with m points, where each point is the

> average (x-bar) of the n measures for that point.

>

> For example, the following dataset (each column being a series):

>

> 157.76 172.89 179.18 152.22 174.40 153.42 67.00 163.44 175.33 160.28

164.07

> 171.33 161.88 161.43 178.95 151.97 156.69 171.71 43.00 161.23 170.08

166.04

> 158.73 42.00 151.60 151.52 31.00 160.85 155.57 151.36 153.55 170.18 166.74

> 157.50 168.66 145.99 157.02 167.71 219.00 165.78 159.45 157.78 161.03

172.20

> 179.97 154.89 168.94 164.86 149.31 170.18

> 164.27 172.18 180.54 160.73 63.00 159.13 152.69 159.98 175.10 166.21

167.33

> 181.68 2.00 165.16 186.49 73.00 164.77 172.91 166.15 163.73 172.56 172.65

> 164.56 169.31 163.39 164.55 167.87 168.50 172.19 166.35 166.24 169.25

172.18

> 164.17 171.27 271.00 163.62 173.74 180.85 179.21 172.67 172.92 170.49

172.94

> 188.32 174.83 178.25 187.25 0.00 179.90

> 167.74 177.38 174.77 157.17 172.35 162.69 163.17 165.43 175.33 166.01

173.22

> 182.28 170.41 180.22 62.00 161.20 172.89 183.24 169.37 171.57 172.39

183.84

> 172.97 179.68 176.17 175.68 171.61 174.59 184.70 91.00 168.34 176.10

184.19

> 3.00 177.84 167.87 177.05 187.35 190.00 191.48 184.47 191.07 174.76 180.36

> 187.76 183.71 179.12 189.91 184.62 186.91

>

> Will produce an x_bar chart with the following values:

>

> 163.26

> 174.15

> 178.17

> 156.71

> 136.58

> 158.41

> 127.62

> 162.95

> 175.26

> 164.17

> 168.20

> 178.43

> 111.43

> 168.94

> 142.48

> 128.72

> 164.78

> 175.95

> 126.17

> 165.51

> 171.68

> 174.17

> 165.42

> 130.33

> 163.72

> 163.92

> 123.50

> 167.98

> 170.82

> 136.24

> 162.71

> 171.84

> 174.37

> 108.23

> 172.59

> 194.95

> 165.89

> 176.27

> 196.62

> 178.83

> 172.20

> 173.92

> 168.76

> 175.17

> 185.35

> 171.14

> 175.44

> 180.67

> 111.31

> 178.99

>

> The x-chart contains only one series. Then the control limits are

calculated

> based on this new data.

>

> I don't understand very well where your data is coming from but it seems

> that you have only one measurement for each sample, in this case, you must

> "transpose" the way you are passing the data, creating a chart with n

series

> and one(1) point. Something like this:

>

> Chart2.OpenData(COD.Values, rst.Tables(0).Rows.Count, 1)

>

> 'Add a point for each sereis to the right of the chart

>

> 'Using the legend property, set the legend values

>

> For nX = 0 To rst.Tables(0).Rows.Count - 1

>

> Chart2.Value(nX,0) = rst.Tables(0).Rows(nX)("Value")

>

> Next nX

>

> Chart2.CloseData(COD.Values)

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

Hi another times,

I've tryed with the code modified you send me (I've just tryed it yesterday

and it don't work but I've retryed another time): If I pass only one series

Chart2.OpenData(COD.Values, rst.Tables(0).Rows.Count, 1)

the chart is unable to create the chart, expose me an X value like "not a

real number" and the dataeditor is blank, If I pass two series

Chart2.OpenData(COD.Values, rst.Tables(0).Rows.Count, 2)

with the same data all goes OK.

I think is a bug on your average function.

Thank you another time

Kind regards

Dario

"Dario Cadei" <dario.cadei@a-team.nu> ha scritto nel messaggio

news:qS7FYBL4DHA.2688@webserver3.softwarefx.com...

> Hi,

>

> OK, I've understand.

>

> Can You also answer my second question about the way to pass to the

> statistical extension the value of the UCL and LCL ? The the USL and LSL

> there's no problem but for It I don't have a "Link" to find the study but

I

> need to loop on the collection and when I find the name change the value.

Is

> this one the only method or I miss something ?

>

> Thank you in advance

> Dario

>

>

>

>

>

> "SoftwareFX Support" <support@softwarefx.com> ha scritto nel messaggio

> news:pQqUX3G4DHA.2468@webserver3.softwarefx.com...

> > I think we fail to explain this in the docs.

> >

> > An x-chart takes a set m of series, each series represents a set of n

> > measures.

> >

> > The resulting x-chart is a chart with m points, where each point is the

> > average (x-bar) of the n measures for that point.

> >

> > For example, the following dataset (each column being a series):

> >

> > 157.76 172.89 179.18 152.22 174.40 153.42 67.00 163.44 175.33 160.28

> 164.07

> > 171.33 161.88 161.43 178.95 151.97 156.69 171.71 43.00 161.23 170.08

> 166.04

> > 158.73 42.00 151.60 151.52 31.00 160.85 155.57 151.36 153.55 170.18

166.74

> > 157.50 168.66 145.99 157.02 167.71 219.00 165.78 159.45 157.78 161.03

> 172.20

> > 179.97 154.89 168.94 164.86 149.31 170.18

> > 164.27 172.18 180.54 160.73 63.00 159.13 152.69 159.98 175.10 166.21

> 167.33

> > 181.68 2.00 165.16 186.49 73.00 164.77 172.91 166.15 163.73 172.56

172.65

> > 164.56 169.31 163.39 164.55 167.87 168.50 172.19 166.35 166.24 169.25

> 172.18

> > 164.17 171.27 271.00 163.62 173.74 180.85 179.21 172.67 172.92 170.49

> 172.94

> > 188.32 174.83 178.25 187.25 0.00 179.90

> > 167.74 177.38 174.77 157.17 172.35 162.69 163.17 165.43 175.33 166.01

> 173.22

> > 182.28 170.41 180.22 62.00 161.20 172.89 183.24 169.37 171.57 172.39

> 183.84

> > 172.97 179.68 176.17 175.68 171.61 174.59 184.70 91.00 168.34 176.10

> 184.19

> > 3.00 177.84 167.87 177.05 187.35 190.00 191.48 184.47 191.07 174.76

180.36

> > 187.76 183.71 179.12 189.91 184.62 186.91

> >

> > Will produce an x_bar chart with the following values:

> >

> > 163.26

> > 174.15

> > 178.17

> > 156.71

> > 136.58

> > 158.41

> > 127.62

> > 162.95

> > 175.26

> > 164.17

> > 168.20

> > 178.43

> > 111.43

> > 168.94

> > 142.48

> > 128.72

> > 164.78

> > 175.95

> > 126.17

> > 165.51

> > 171.68

> > 174.17

> > 165.42

> > 130.33

> > 163.72

> > 163.92

> > 123.50

> > 167.98

> > 170.82

> > 136.24

> > 162.71

> > 171.84

> > 174.37

> > 108.23

> > 172.59

> > 194.95

> > 165.89

> > 176.27

> > 196.62

> > 178.83

> > 172.20

> > 173.92

> > 168.76

> > 175.17

> > 185.35

> > 171.14

> > 175.44

> > 180.67

> > 111.31

> > 178.99

> >

> > The x-chart contains only one series. Then the control limits are

> calculated

> > based on this new data.

> >

> > I don't understand very well where your data is coming from but it seems

> > that you have only one measurement for each sample, in this case, you

must

> > "transpose" the way you are passing the data, creating a chart with n

> series

> > and one(1) point. Something like this:

> >

> > Chart2.OpenData(COD.Values, rst.Tables(0).Rows.Count, 1)

> >

> > 'Add a point for each sereis to the right of the chart

> >

> > 'Using the legend property, set the legend values

> >

> > For nX = 0 To rst.Tables(0).Rows.Count - 1

> >

> > Chart2.Value(nX,0) = rst.Tables(0).Rows(nX)("Value")

> >

> > Next nX

> >

> > Chart2.CloseData(COD.Values)

> >

> > --

> > FP

> > Software FX, Inc.

> >

> >

>

>

Link to comment
Share on other sites

Hi,

Another Question:

I've an Histogram Chart but I need to pass data that have decimal value, but

the property

Intervals

LimitLeft

LimitRight

are integer and also the dataeditor use integer value; is a bug, is right (I

hope not), why ?

Thank you another time

Dario

"Dario Cadei" <dario.cadei@a-team.nu> ha scritto nel messaggio

news:YBqt3sE4DHA.2468@webserver3.softwarefx.com...

> Hi All,

>

> I'm passing data read from a database to a XChart with a VB.NET code like

> this:

>

>

>

> Dim nX As Integer

>

> StatisticsX = New Statistics

>

> StatisticsX.Chart = Chart2

>

> Chart2.OpenData(COD.Values, 1, rst.Tables(0).Rows.Count)

>

> 'Add a point for each sereis to the right of the chart

>

> 'Using the legend property, set the legend values

>

> For nX = 0 To rst.Tables(0).Rows.Count - 1

>

> Chart2.Value(0, nX) = rst.Tables(0).Rows(nX)("Value")

>

> Next nX

>

> Chart2.CloseData(COD.Values)

>

> Chart2.GalleryObj = StatisticsX.Gallery.XChart

>

> StatisticsX.LegendBox = True

>

> StatisticsX.LegendBoxObj.SizeToFit()

>

> 'Set Limit's

>

> StatisticsX.Calculators(0).Lsl = rst.Tables(0).Rows(0)("LSL")

>

> StatisticsX.Calculators(0).Usl = rst.Tables(0).Rows(0)("USL")

>

>

>

> Now I've two problem:

>

> 1. How to access to the LCL and UCL value

>

> 2. The dataeditor and the chart work only on 1 value but my DB Table have

> more data (nearly 100 value but I've tryed also with only 2 or 3 and It

> seems it makes a average of all the data value I pass).

>

> Please Help me.

>

> Dario

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...