Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Chart line
private void M_getreport() 
{
    String _strdata = "<chart caption='Temperature Monitoring (in degree C)' subCaption='(on 7/9/2006)' xAxisName='Time' yAxisMaxValue='100' bgColor='91AF46,FFFFFF'  divLineColor='91AF46' divLineAlpha='30' alternateHGridAlpha='5' canvasBorderColor='666666' baseFontColor='666666' lineColor='91AF46' numVDivlines='7' showAlternateVGridColor='1' anchorSides='3' anchorRadius='5' showValues='0' >";
    ArrayList ItemList = new ArrayList();
    ItemList.Add("No");
    ItemList.Add("JA");
    ItemList.Add("FB");
    ItemList.Add("MR");
    ItemList.Add("AP");
    ItemList.Add("MA");
    ItemList.Add("JU");
    ItemList.Add("JL");
    ItemList.Add("AU");
    ItemList.Add("SE");
    ItemList.Add("OC");
    ItemList.Add("NA");
    ItemList.Add("DS");
    Int32 _frommonth = 3;
    Int32 _Tfrommonth = 3;
    Int32 _tomonth = 9;
    Int32 _loop = _tomonth - _frommonth;
    Int32 _val = _tomonth - _frommonth;
    _strdata += "<categories>";
    int i = 0;
    for (i = _frommonth; i <= _tomonth; i++)
    {
        _strdata += "<category label='" + ItemList[i] + "' /> ";
    }
 
    String _lastyer = "0";
 
    _strdata += "</categories>";
 
    var random = new Random();
 
    DataSet _ds = _ManagePointMaster.SP_checkreport(2009, 2012, _frommonth, _tomonth);
 
    for ( int j = 0; j < _ds.Tables[0].Rows.Count;j++)
    {
        if(_lastyer!=_ds.Tables[0].Rows[j]["year"].ToString())
        {
            if (_lastyer != "0")
            {
 
                if (_loop < _val)
                {
                    for (i = 0; i <= _loop; i++)
                    {
                        _strdata += "<set value='0' /> ";
                    }
                    _loop = _val;
                    _frommonth = _Tfrommonth;
                }
 
                _strdata += "</dataset>";
 
            }
            //var color = String.Format("#{0:X6}", random.Next(0x1000000));

            _strdata += "<dataset seriesName='" + _ds.Tables[0].Rows[j]["year"].ToString() + "' color='" + String.Format("#{0:X6}", random.Next(0x1000000)) + "'>";
 
            _lastyer = _ds.Tables[0].Rows[j]["year"].ToString();
        }
 
        for (Int32 k = _frommonth; k <= _tomonth+1; k++)
        {
            if (k.ToString() != _ds.Tables[0].Rows[j]["Month"].ToString())
            {
                _status = 1;
                _strdata += "<set value='0' /> ";
 
                _loop = _loop - 1;
                _frommonth += 1;
                //break;
            }
            else
            {
                _strdata += "<set  value='" + _ds.Tables[0].Rows[j]["LID"].ToString() + "' /> ";
 
                   _loop = _loop - 1;
                _frommonth += 1;
                break;
            }
        }
 

    }
 
    if (_loop < _val)
    {
        for (i = 0; i <= _loop; i++)
        {
            _strdata += "<set value='0' /> ";
            }
 
    }
 
    _strdata += "</dataset>";
 

       _strdata += "<styles>";
        _strdata += "<definition>";
 
        _strdata += "<style name='Anim1' type='animation' param='_alpha' start='0' duration='1' />";
 
    _strdata += "</definition>";
 
    _strdata += "<application>";
 
        _strdata += "<apply toObject='TRENDLINES' styles='Anim1' />";
 
    _strdata += "</application>";
 
_strdata += "</styles>";
 
    _strdata += "</chart>";
 

    txtdescc.Text = _strdata;
    Literal2.Text = FusionCharts.RenderChartHTML("FusionCharts/ScrollLine2D.swf", "", _strdata.ToString(), "myNext", "800", "500", false);
    //Response.Write(_strdata);

}
Posted 29-Jun-12 2:29am
Edited 29-Jun-12 3:28am
(no name)125.2K
v2
Comments
ryanb31 at 29-Jun-12 8:28am
   
Do you have a question?
Dylan Morley at 29-Jun-12 8:30am
   
That looks lovely, do you have a question?

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

  Print Answers RSS
0 OriginalGriff 490
1 Maciej Los 305
2 Richard MacCutchan 270
3 Mathew Soji 220
4 BillWoodruff 210
0 OriginalGriff 8,834
1 Sergey Alexandrovich Kryukov 7,477
2 DamithSL 5,689
3 Maciej Los 5,329
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web03 | 2.8.1411028.1 | Last Updated 29 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100