Building charts with Dundas Charts and SqlDataSource

Written by Alexander. Posted in Uncategorized

Dundas has a very good Chart controls which I am using now in my project. And if you are familiar with Microsoft Charts you can easy start using Dundas charts, because Microsoft Charts based on Dundas charts.

Chart controls support SqlDataSource, and all than you need is Bind SqlDataSource to Dundas charts and tell charts what fields to use from DataSource.

<asp:SqlDataSource runat="server" ProviderName="System.Data.OracleClient" SelectCommand="select AxisX, AxisY from chart_values"

    ID="SqlData"></asp:SqlDataSource>
<DCWC:Chart ID="Chart1" runat="server" DataSourceID="SqlData"
    Width="1000px" Height="600px">
    <Legends>
        <DCWC:Legend TitleFont="Microsoft Sans Serif, 8pt, style=Bold"
            BackColor="Transparent" EquallySpacedItems="True" Font="Trebuchet MS, 8pt, style=Bold"
            AutoFitText="False" Name="Default">
        </DCWC:Legend>
    </Legends>
    <Series>
        <DCWC:Series ValueMemberX="AxisX" ValueMembersY="AxisY">
        </DCWC:Series>
    </Series>
    <ChartAreas>
        <DCWC:ChartArea Name="Default">
            <AxisX LineColor="Blue">
            </AxisX>
            <AxisY LineColor="Red">
            </AxisY>
            <Area3DStyle Enable3D="True" />
        </DCWC:ChartArea>
    </ChartAreas>
</DCWC:Chart>

clip_image001

Trackback from your site.

Leave a comment