开发者

chart control trouble in webforms, images are not showing

My chart controls stop working after migration, I am putting the code and maybe you can identify the error. It doesn't show anything, in Firefox is like it can't find the image just a X icon and nothing. Some help will be appreciated.

    <asp:Chart ID="chart" runat="server" BackColor="Azure" Width="480px" 
   BackGradientStyle="LeftRight" BackSecondaryColor="PowderBlue" 
   BorderlineColor="">
   <BorderSkin BackColor="" 
       BorderColor="" PageColor="Transparent" />
   <Titles>
       <asp:Title Font="Microsoft Sans Serif, 16pt" ForeColor="0, 0, 64" Name="Title1" 
           Text="Earnigs by activity">
       </asp:Title>
   </Titles>
   <series>
       <asp:Series Name="Default" ChartType="Bar" IsValueShownAsLabel="True" 
           CustomProperties="PixelPointWidth=20, DrawingStyle=Cylinder" 
           ShadowOffset="2" LabelFormat="N2">
       </asp:Series>
   </series>
   <chartareas>
       <asp:ChartArea Name="ChartArea1" BorderDashStyle="Solid" 
           BorderColor="64, 64, 64, 64">
           <AxisY LineColor="64, 64, 64, 64" Title="Revenue">
               <MajorGrid LineColor="64, 64, 64, 64" />
               <MinorGrid LineColor="64, 64, 64, 64" />
           </AxisY>
           <AxisX LineColor="64, 64, 64, 64" IntervalAutoMode="VariableCount">
               <MajorGrid LineColor="64, 64, 64, 64" />
               <MinorGrid LineColor="64, 64, 64, 64" />
           </AxisX>
           <AxisX2 LineColor="64, 64, 64, 64">
           </AxisX2>
           <AxisY2 LineColor="64, 64, 64, 64">
           &开发者_开发问答lt;/AxisY2>
       </asp:ChartArea>
   </chartareas>

I am binding this dynamically from database.

chartTotalsByActivities.Series["Default"].Points.
DataBind(list, "Name", "Money","Tooltip=Money{N2}");


Well, finally I solved the problem and I am going to share it if someone is having the same problem.

I am using routing and I had patters which match with the URL that image was requesting, so you have to ignore the route in UrlRouting for serving rightfully the image.

RouteTable.Routes.Add(new Route("{resource}/{name}.axd", new StopRoutingHandler()));

It worked with that, I tried with

RouteTable.Routes.Add(new Route("{*resource}.axd", new StopRoutingHandler()));

but it ignored all my other routes, maybe someone have a better solution.

thanks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜