1 Reply Latest reply on May 11, 2009 4:11 AM by Mohd Fayaz

    BarChart within DataGrid

    Mohd Fayaz Level 1

      Is it possible to display a 3-series small bar chart within DataGrid? I have been trying for long, but I am not able to get it. When I use Item Renderer to display a barchart within Datagrid, the DataGrid itself disappears on the page. Here is a sample code I have been trying. Please help me out....

       

          <mx:DataGrid x="155" y="109" width="399" dataProvider="{dgData2}">
              <mx:columns>
                  <mx:DataGridColumn headerText="Machine" dataField="machine"/>
                  <mx:DataGridColumn headerText="Availablity" dataField="available"/>
                  <mx:DataGridColumn headerText="Status" dataField="status">
                  <mx:itemRenderer>
                       <mx:Component>
                            <mx:BarChart height="69" width="162"
                            paddingLeft="5" paddingRight="5"
                            showDataTips="true">
                     
                            <mx:verticalAxis>
                            <mx:CategoryAxis categoryField="Country"/>
                            </mx:verticalAxis>

       

                     
                            <mx:series>
                           <mx:BarSeries
                               xField="Critical"
                               displayName="Critical"
                           />
                           <mx:BarSeries
                               xField="Error"
                               displayName="Error"
                           />
                           <mx:BarSeries
                               xField="Warning"
                               displayName="Warning"
                           />

                      </mx:series>


                          </mx:BarChart>
                      </mx:Component>
                      </mx:itemRenderer> -->      
                  </mx:DataGridColumn>
              </mx:columns>
          </mx:DataGrid>

       


          <mx:XMLList id="dgData2" xmlns="">
              <record>
                  <machine>Machine1</machine>
                  <available></available>
                  <status>
                      <Critical>35</Critical>
                      <Error>39</Error>
                      <Warning>29</Warning>
                  </status>
              </record>
              <record>
                  <machine>Machine2</machine>
                  <available></available>
                  <status>
                      <Critical>35</Critical>
                      <Error>39</Error>
                      <Warning>29</Warning>
                  </status>
              </record>
              <record>
                  <machine>Machine3</machine>
                  <available></available>
                  <status>
                      <Critical>35</Critical>
                      <Error>39</Error>
                      <Warning>29</Warning>
                  </status>
              </record>
          </mx:XMLList>