Open Flash Chart 坐标 中文旋转

版本:open-flash-chart-2-Lug-Wyrm-Charmer

前台页面  index.aspx

 

ExpandedBlockStart.gif 代码
< html >
< head >
< script  type ="text/javascript"  src ="swfobject.js" ></ script >
< script  type ="text/javascript" >
swfobject.embedSWF(
" open-flash-chart-SimplifiedChinese.swf " " my_chart " " 550 " " 300 " ,
" 9.0.0 " " expressInstall.swf " ,
{
" data-file " : "data.aspx " }
);
</ script >

</ head >
< body >

< p > Hello World </ p >
< div  id ="my_chart" ></ div >
</ body >
</ html >
data.aspx.cs
ExpandedBlockStart.gif 代码
using  System;
using  System.Collections.Generic;
using  System.Data;
using  System.Configuration;
using  System.Collections;
using  System.Web;
using  System.Web.Security;
using  System.Web.UI;
using  System.Web.UI.WebControls;
using  System.Web.UI.WebControls.WebParts;
using  System.Web.UI.HtmlControls;
using  OpenFlashChart;

public   partial   class  data : System.Web.UI.Page
{
    
protected   void  Page_Load( object  sender, EventArgs e)
    {
        OpenFlashChart.OpenFlashChart chart 
=   new  OpenFlashChart.OpenFlashChart();
        List
< double >  data1  =   new  List < double > ();

        
for  ( double  i  =   0 ; i  <   6.2 ; i  +=   0.2 )
        {
            data1.Add(Math.Sin(i) 
*   1.9   +   7 );
        
        }

        OpenFlashChart.LineHollow line1 
=   new  LineHollow();
        line1.Values 
=  data1;
        line1.HaloSize 
=   1 ;
        line1.Width 
=   2 ;
        line1.DotSize 
=   5 ;

        chart.AddElement(line1);
        chart.Y_Legend 
=   new  Legend( " Y轴坐标 " );
        chart.Title 
=   new  Title( " 中文测试 " );
        chart.Y_Axis.SetRange(
0 15 5 );

        chart.X_Axis.SetLabels(
new   string [] {  " 中文测试 "  , " 第二 " });
        
        chart.X_Axis.Steps 
=   2 ;
        chart.X_Axis.Labels.VisibleSteps 
=   2 ;

        chart.X_Axis.Labels.Rotate
=   " 45 " //  旋转45度
        Response.Clear();
        Response.CacheControl 
=   " no-cache " ;
        Response.Write(chart.ToPrettyString());
        Response.End();
    }
}

 

 

另外,就一个单单页面好像不能让中文旋转。

如下页面

dataextend.aspx

ExpandedBlockStart.gif 代码
 1  <% @ Page Language = " C# "  AutoEventWireup = " true "  CodeFile = " dataextend.aspx.cs "  Inherits = " dataextend "   %>
 2  <% @ Register Assembly = " OpenFlashChart "  Namespace = " OpenFlashChart "  TagPrefix = " cc1 "   %>
 3  <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
 4 
 5  < html  xmlns ="http://www.w3.org/1999/xhtml"   >
 6  < head  runat ="server" >
 7       < title > 无标题页 </ title >
 8  </ head >
 9  < body >
10       < form  id ="form1"  runat ="server" >
11       < cc1:OpenFlashChartControl  ID ="OpenFlashChartControl1"  runat ="server" >
12               </ cc1:OpenFlashChartControl >
13       </ form >
14  </ body >
15  </ html >

 

dataextend.aspx.cs

 

ExpandedBlockStart.gif 代码
using  System;
using  System.Collections.Generic;
using  System.Data;
using  System.Configuration;
using  System.Collections;
using  System.Web;
using  System.Web.Security;
using  System.Web.UI;
using  System.Web.UI.WebControls;
using  System.Web.UI.WebControls.WebParts;
using  System.Web.UI.HtmlControls;
using  OpenFlashChart;

public   partial   class  dataextend : System.Web.UI.Page
{
    
protected   void  Page_Load( object  sender, EventArgs e)
    {
        OpenFlashChart.OpenFlashChart chart 
=   new  OpenFlashChart.OpenFlashChart();
        List
< double >  data1  =   new  List < double > ();

        
for  ( double  i  =   0 ; i  <   6.2 ; i  +=   0.2 )
        {
            data1.Add(Math.Sin(i) 
*   1.9   +   7 );
        
        }

        OpenFlashChart.LineHollow line1 
=   new  LineHollow();
        line1.Values 
=  data1;
        line1.HaloSize 
=   1 ;
        line1.Width 
=   2 ;
        line1.DotSize 
=   5 ;
        chart.AddElement(line1);
        chart.Y_Legend 
=   new  Legend( " Y轴坐标 " );
        chart.Title 
=   new  Title( " 中文测试 " );
        chart.Y_Axis.SetRange(
0 15 5 );

        chart.X_Axis.SetLabels(
new   string [] {  " 中文测试 "  , " 第二 " });
        
        chart.X_Axis.Steps 
=   2 ;
        chart.X_Axis.Labels.VisibleSteps 
=   2 ;

        chart.X_Axis.Labels.Rotate
=   " 45 " // 这里旋转了 但是无用
        OpenFlashChartControl1.Chart  =  chart;
     }
}

 

 

 

 

转载于:https://www.cnblogs.com/merseyalma/archive/2009/12/04/1617312.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值