日期:2014-05-17  浏览次数:20461 次

制作网页图形
现在数据库中存有横坐标和纵坐标的值,我想调取数据库中的数据,然后以BS结构的形式,在网页中显示出一个这样的图形:“具有横坐标轴和纵坐标轴,并且横坐标和纵坐标的值都是来自于数据库中,这些横坐标和纵坐标所确定的点连接起来会形成一条曲线或者是直线。”我该怎么做呢?请各位大师指教啊!如果谁有类似的项目让我看一看啊!谢谢!

------解决方案--------------------
function(x,y){
var canvas = document.getElementById( "cv ");
var context = canvas.getContext( "2d ");
context.beginPath();
context.lineTo(0,0);
context.moveTo(x,y);
context.stroke();
}

<canvas id= "cv "> </canvas>
------解决方案--------------------
Chart

HTML code

<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>


<asp:Chart ID="chQxhz" runat="server" BackColor="211, 223, 240" BackGradientStyle="TopBottom"
            BorderColor="#B54001" BorderlineDashStyle="Solid" BorderWidth="2px" Height="300px"
            ImageLocation="~/TempImages/ChartPic_#SEQ(300,3)" Width="400px">
            <Legends>
                <asp:Legend Docking="Bottom" Name="Legend1">
                </asp:Legend>
            </Legends>
            <Titles>
                <asp:Title Font="Trebuchet MS, 12pt, style=Bold" ForeColor="26, 59, 105" ShadowColor="32, 0, 0, 0"
                    ShadowOffset="3" Text="Chart">
                </asp:Title>
            </Titles>
            <BorderSkin SkinStyle="Emboss" />
            <Series>
                <asp:Series BorderColor="180, 26, 59, 105" BorderWidth="3" ChartType="Line" Color="220, 65, 140, 240"
                    MarkerSize="8" MarkerStyle="Circle" Name="thirdfind" LegendText="C1" ShadowColor="Black"
                    ShadowOffset="2" XValueType="Double" YValueType="Double" Legend="Legend1">
                </asp:Series>
                <asp:Series BorderColor="180, 26, 59, 105" BorderWidth="3" ChartType="Line" Color="220, 224, 64, 10"
                    MarkerSize="8" MarkerStyle="Circle" Name="selffind" LegendText="C2" ShadowColor="Black"
                    ShadowOffset="2" XValueType="Double" YValueType="Double" Legend="Legend1">
                </asp:Series>
                <asp:Series ChartArea="ChartArea1" ChartType="Line" Legend="Legend1" Name="ortherfind"
                    LegendText="C3">
                </asp:Series>
                <asp:Series ChartArea="ChartArea1" ChartType="Line" Legend="Legend1" Name="orther"
                    LegendText="C4">
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea BackColor="OldLace" BackGradientStyle="TopBottom" BackSecondaryColor="White"
                    BorderColor="64, 64, 64, 64" BorderDashStyle="Solid" Name="ChartArea1" ShadowColor="Transparent">
                    <Area3DStyle Inclination="40" IsClustered="False" IsRightAngleAxes="False" LightStyle="Realistic"
                        Perspective="9" Rotation="25" WallWidth="3" />
                    <AxisY LineColo