Webmatrix Charts font size

I’ve created my own theme and everything is good – except that I would really like to change the font on the VALUES on the axis (NOT label font)… Is that possible and if yes – HOW??

Kind Regards Mette

Hi Mette,

Base on my test, I custom the theme in an xml file, other styles works fine except the font size.

This is my code below:

<?xml version="1.0" encoding="utf-8" ?>
<Chart BackColor="#D3DFF0" BackGradientStyle="TopBottom"
   BackSecondaryColor="White" BorderColor="26, 59, 105"
   BorderlineDashStyle="Solid" BorderWidth="2" Palette="BrightPastel">
<ChartAreas>
    <ChartArea Name="Default" _Template_="All" BackColor="64, 165, 191, 228"
               BackGradientStyle="TopBottom" BackSecondaryColor="White"
               BorderColor="64, 64, 64, 64" BorderDashStyle="Solid"
               ShadowColor="Transparent"
               >
        <AxisY>
            <LabelStyle Font="Arial,
                        50pt, style=Italic" />
        </AxisY>
        <AxisX>
            <LabelStyle Font="Arial,
                       50pt, style=Bold,Italic" />
        </AxisX>
    </ChartArea>
</ChartAreas>
<Legends>
    <Legend _Template_="All" BackColor="Transparent"
            Font="Arial, 10pt, style=Bold, Italic" IsTextAutoFit="False" />
</Legends>
<BorderSkin SkinStyle="Emboss" />
</Chart>

I suggest that you could submit the feedback
http://aspnet.uservoice.com/forums/41199-general-asp-net
, after submit it, and please post the link here which will benefit to others who has the similar issue.

Best Regards

Starain Chen

Thank you for your answer Starain. But it does not help me to change the font of the VALUES on the axis of the chart – wich is what I really want…

I have made my xml wich looks like this and works fine:

<Chart   BackColor="Transparent" Palette="None" PaletteCustomColors="203,216,51;" >
                   
                    <ChartAreas>
                        <ChartArea Name="Default" BackColor="Transparent" >
                            <AxisY > 
                                <MajorGrid LineColor="179, 179, 179" />  
                                                        
                            </AxisY>
                            <AxisX >
                                <LabelStyle Interval="1" />
                                <MajorGrid Enabled="False" />
  
                            </AxisX>
                        </ChartArea>
                    </ChartAreas> 
                                     
                </Chart>

I can see you have the line 

<BorderSkin SkinStyle=""Emboss"" />

in your xml wich actually changes the font byt it also changes a lot of other stuff wich I’m not interested in… 

And with the post you suggest that I make is that for when I find the answer or will it help me find the answer?? 

Sorry – I’m kind of new in this world…

Regards Mette

 

Hi Mette,

For your code, which code don’t work? Do you want to change the size?

Please share the project on the OneDrive.

You may refer to this article below to save the chart to XML and check the details (Saving a Chart as an XML File section).

# Displaying Data in a Chart with ASP.NET Web Pages (Razor)

http://www.asp.net/web-pages/overview/data/7-displaying-data-in-a-chart

Best Regards

Starain

Leave a Reply