cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with bar graph

Former Member
0 Kudos

Hi Forum,

I am building a stacked bar graph to show the material consumptions at batch levels. A single batch can consume multiple materials and after a lot of difficulty i built an XML of the following row format :

........

<Row>

<BatchName>PS1003001</BatchName>

<CalciumCarbonate>5</CalciumCarbonate>

<2-Methyltetrahydrofuran>0.01</2-Methyltetrahydrofuran>

</Row>

......

This is showing a stacked bar with different colors for different materials. That is perfect and what is expected.

To show a stacked bar graph of materials, is there any other format that xMII can understand or is this the only format ?

Now, the problem: XML wont allow to build tag names starting with a number. It should be always an alphabet.

But there is very high probability that material names begin with numbers.

Can any one tell me how to solve the problem other than adding some dummy character at the beginning or removal of number.

Thanks a lot,

Mike.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Michael:

As you discovered, that isn't "valid" XML (it has nothing to do with xMII) - element names cannot start with numbers or include certain special characters (such as 2-Methyltetrahydrofuran).

I would reshape your XML like the following:

<Row>

<BatchName>PS1003001</BatchName>

<Material>CalciumCarbonate</Material>

<Quantity>5</Quantity>

</Row>

<Row>

<BatchName>PS1003001</BatchName>

<Material>2-Methyltetrahydrofuran</Material>

<Quantity>0.01</Quantity>

</Row>

In the data binding tab for your stacked bar chart display template, try adding "Quantity" to the value columns, "Material" to the label columns, and "BatchName" to the axis label column.

Just be certain that you have a row for each material for each batch, even if the quantity is zero or NA.

Rick

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Rick,

This approach is working perfectly fine. Thanks a lot for your help.

Thanks,

Mike.