Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I am creating a fusionchart HLinearGauge.

Below is my sample XML format

C#
<graph lowerLimit='0' upperLimit='100' lowerLimitDisplay='Bad' upperLimitDisplay='Good' palette='1' numberSuffix='%' chartRightMargin='20'>

  <colorRange>
    <color minValue='0' maxValue='75' code='FF654F' label='Bad' />
    <color minValue='75' maxValue='90' code='F6BD0F' label='Moderate' />
    <color minValue='90' maxValue='100' code='8BBA00' label='Good' />
  </colorRange>

  <pointers>
    <pointer value='92' />
  </pointers>
</graph>


Below is my code behind

C#
protected void Page_Load(object sender, EventArgs e)
        {
            Literal1.Text = InfoSoftGlobal.FusionCharts.RenderChartHTML("FusionCharts/HLinearGauge.swf", "XML/Gauges.xml", "", "chart", "448", "250", false);
        }


When I run the code it shows, error on loading data
Posted

1 solution

Try to save this XML value in a variable and pass the variable into the Fusionchart.

string value =
XML
@"<graph >

  <colorRange>
    <color minValue='0' maxValue='75' code='FF654F' label='Bad' />
    <color minValue='75' maxValue='90' code='F6BD0F' label='Moderate' />
    <color minValue='90' maxValue='100' code='8BBA00' label='Good' />
  </colorRange>

  <pointers>
    <pointer value='92' />
  </pointers>
</graph>";


Literal1.Text = InfoSoftGlobal.FusionCharts.RenderChartHTML("FusionCharts/HLinearGauge.swf", "", value, "chart", "448", "250", false);
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900