以单个显示位图和图表控件 [英] To show bitmap and chartcontrol in single

查看:77
本文介绍了以单个显示位图和图表控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在我的应用程序中,我有一个MSChart控件和一个位图.

我想在单个< td>中显示两个图形.标签,但条件是我想显示位图,并且恰好在我的图表旁边.

我已经在相同的< td>中收集了两个图纸.标签,但是在编译并运行我的应用程序后,它会在图表控件上方显示位图,这是不期望的.
有人可以帮我吗?

还有什么其他方法可以使两个图彼此非常接近.

源代码:

Hello all,

In my application I have one MSChart control and one bitmap.

I want to show both drawings in single <td> tag, but the condition is that I want to show bitmap and exactly beside that my chart.

I had already collected both the drawings in same <td> tag, but after compiling and running my application it shows bitmap above my chart control, which is not expected.
Can anybody help me to do that?

Is there any another method to show both the drawings very close to each other.

Source code :

<td align="left" style="padding-left:0;Width:100%">
<img  src="Guge.aspx"  style="padding-right:0"/>
    <%--<asp:Chart ID="ChartSpark" runat="server" Height="50px" Width="80px"
        EnableViewState="True">
        <Series>
            <asp:Series Name="Series1" ChartType="Spline" LabelForeColor="DarkRed"
                MarkerBorderColor="Red" Font="Times New Roman, 7.25pt">
            </asp:Series>
         </Series>
        <ChartAreas>
            <asp:ChartArea Name="ChartArea1">
                <AxisY LineColor="Silver">
                    <MajorGrid Interval="5" LineColor="White" />
                    <MinorGrid Enabled="True" LineColor="White" />
                    <MajorTickMark Interval="5" />
                    <MinorTickMark LineColor="White" />
                    <LabelStyle Enabled="False" />
                </AxisY>
                <AxisX LineColor="Silver" IsLabelAutoFit="False" LabelAutoFitMaxFontSize="5">
                    <MajorGrid Enabled="True" Interval="1" LineColor="White" />
                    <MinorGrid Enabled="True" LineColor="White" />
                    <MajorTickMark LineColor="White" />
                    <LabelStyle Enabled="False" Interval="1" />
                </AxisX>
            </asp:ChartArea>
        </ChartAreas>
    </asp:Chart>--%>
    <asp:Chart ID="Chart3" runat="server" Height="25px" Palette="None" Width="150px">
      <Series>
             <asp:Series Name="Series1" ChartType="Point" Font="Times New Roman, 5.5pt, style=Bold"

                 MarkerBorderWidth="0" MarkerSize="0" MarkerStep="10" BorderWidth="0"

                 ShadowColor="0, 0, 0, 0" LabelForeColor="OrangeRed">
                <Points>
                       <asp:DataPoint XValue="0" YValues="0"   /><%--Label="M1"--%>
                      <asp:DataPoint XValue="10" YValues="0"   />
                       <asp:DataPoint XValue="20" YValues="0"  />
                       <asp:DataPoint XValue="30" YValues="0"   />
                       <asp:DataPoint XValue="40" YValues="0" />
                       <asp:DataPoint XValue="50" YValues="0"  />
                       <asp:DataPoint XValue="60" YValues="0"  />
                       <asp:DataPoint XValue="100" YValues="0" />
               </Points>
          </asp:Series>
     </Series>
     <ChartAreas>
        <asp:ChartArea Name="ChartArea1" BorderColor="Transparent" BorderWidth="0">
            <AxisY LineColor="Transparent" IsMarginVisible="False">
            </AxisY>
             <AxisX IsLabelAutoFit="False" LineColor="Transparent" IsMarksNextToAxis="False" LineDashStyle="NotSet">
                <MajorGrid Enabled="False" LineColor="Transparent" />
                <MajorTickMark Enabled="False" LineColor="Transparent" />
                <LabelStyle Font="Microsoft Sans Serif, 5pt" />
                 <CustomLabels>
                     <asp:CustomLabel />
                 </CustomLabels>
            </AxisX>
        </asp:ChartArea>
     </ChartAreas>
 </asp:Chart>
       <%--  <img src="mlabels.aspx" />--%>

             <asp:Chart ID="ChartSpark" runat="server" Height="50px" Width="150px" ImageLocation="Left">

        <Series>
    <%-- Extra Series to Show Zeroth line in A graph--%>
            <asp:Series Name="Series2" ChartType="Line" LabelForeColor="DarkRed"

                MarkerBorderColor="Black" Font="Times New Roman, 5pt" Color="DimGray" BorderWidth="1" BorderDashStyle="DashDot" MarkerStep="5" >
               <Points>

               <asp:DataPoint XValue="0" YValues="0" />
               <asp:DataPoint XValue="10" YValues="0"/>
               <asp:DataPoint XValue="20" YValues="0"/>
               <asp:DataPoint XValue="30" YValues="0"/>
               <asp:DataPoint XValue="40" YValues="0"/>
               <asp:DataPoint XValue="50" YValues="0"/>
               <asp:DataPoint XValue="60" YValues="0"/>
               <asp:DataPoint XValue="70" YValues="0"/>
               <asp:DataPoint XValue="80" YValues="0"/>
               <asp:DataPoint XValue="90" YValues="0"/>
               <asp:DataPoint XValue="100" YValues="0" />

             </Points>
            </asp:Series>


             <%-- Actual Sparkline Seriese--%>
            <asp:Series Name="Series1" ChartType="Spline" LabelForeColor="DarkRed"

                MarkerBorderColor="Red" Font="Times New Roman, 7pt" >
            </asp:Series>


             </Series>


          <ChartAreas>
            <asp:ChartArea Name="ChartArea1" BorderWidth="0">
                <AxisY LineColor="White" IsLabelAutoFit="False" LabelAutoFitMaxFontSize="5"  IsLogarithmic="False" >
                    <MajorGrid Enabled="True" Interval="7" LineColor="Black" />
                    <MinorGrid Enabled="True" Interval="7" LineColor="Black" />
                    <MajorTickMark Interval="10" LineColor="White" />
                    <MinorTickMark LineColor="DimGray" />
                    <LabelStyle Enabled="False"  Interval="1"/>
                 </AxisY>
                <AxisX LineColor="White" IsLabelAutoFit="False" LabelAutoFitMaxFontSize="5"  IsLogarithmic="False" >
                    <MajorGrid Enabled="True" Interval="1" LineColor="Silver"/>
                    <MinorGrid Enabled="True" LineColor="Silver" />
                    <MajorTickMark LineColor="Silver" />
                    <LabelStyle Enabled="False" Interval="1" />
                 </AxisX>
                <AxisX2 LineColor="Transparent" LineWidth="0" LabelAutoFitMaxFontSize="5"

                    LabelAutoFitMinFontSize="5" IsLabelAutoFit="False" Interval="5">
                    <MajorGrid Enabled="False" LineColor="Transparent" />
                    <MajorTickMark Enabled="False" />
                    <LabelStyle Font="Times New Roman, 6pt, style=Bold" ForeColor="MenuHighlight" />



                </AxisX2>
            </asp:ChartArea>
        </ChartAreas>
    </asp:Chart>
   <asp:Chart ID="Chart4" runat="server" Height="25px" Palette="None"

    Width="150px">
    <Series>
     <%-- Extra Series to Show Percentage line in A graph--%>
        <asp:Series Name="Series1" ChartType="Point" Font="Times New Roman, 6.75pt, style=Bold"

            MarkerBorderWidth="0" MarkerSize="0" MarkerStep="10" BorderWidth="0"

            LabelForeColor="SteelBlue" ShadowColor="0, 0, 0, 0">
           <Points>
               <asp:DataPoint XValue="-30" YValues="0" Label="0%"  />
               <asp:DataPoint XValue="10" YValues="0"   />
               <asp:DataPoint XValue="20" YValues="0"  />
               <asp:DataPoint XValue="40" YValues="0"   />
                <asp:DataPoint XValue="50" YValues="0"   Label="50%"   /><%--Label="50%"--%>
               <asp:DataPoint XValue="60" YValues="0"  />
               <asp:DataPoint XValue="130" YValues="0" Label="100%" MapAreaAttributes=""

                   ToolTip="" Url=""   />
             </Points>
        </asp:Series>
    </Series>
    <ChartAreas>
        <asp:ChartArea Name="ChartArea1" BorderColor="Transparent" BorderWidth="0">
            <AxisY LineColor="Transparent" IsMarginVisible="False">
            </AxisY>
            <AxisX IsLabelAutoFit="False" LineColor="Transparent" IsMarksNextToAxis="False"

                LineDashStyle="NotSet">
                <MajorGrid Enabled="False" LineColor="Transparent" />
                <MajorTickMark Enabled="False" LineColor="Transparent" />
                <LabelStyle Font="Microsoft Sans Serif, 5pt" />
                <CustomLabels>
                    <asp:CustomLabel ForeColor="Gray" Text="0%"  />
                </CustomLabels>
            </AxisX>
        </asp:ChartArea>
    </ChartAreas>
</asp:Chart>
</td>




谢谢&问候
Yogesh




Thanks & regards
Yogesh

推荐答案

Use a table:

Use a table:

<style type="text/css">td img {display: block;}</style>
...
...
<table border="0" cellpadding="0" cellspacing="0">
  <tr>
   <td>
     ... image ...
   </td>
   <td>
     ... chart ...
   </td>
  </tr>
</table>



This is one if the easier ways to fix your problem ...

问候
Espen Harlinn



This is one if the easier ways to fix your problem ...

Regards
Espen Harlinn


Habe you thought of using Float?
Habe you thought of using Float?


这篇关于以单个显示位图和图表控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆