sd_dracula
sd_dracula

Reputation: 3896

asp.net Chart colours

How to set the grid/text colour of an asp:chart?

I'm refering to the colour of the gridlines and the colour of the text on the x and y axis?

Basically I want the black grid and black text below to be shown as white. enter image description here

Upvotes: 1

Views: 1173

Answers (1)

Tim
Tim

Reputation: 1286

In your ChartArea you need to set the X and Y axis colors:

<ChartAreas>
   <asp:ChartArea Name="ChartArea1" >
       <AxisY>
          <MajorGrid LineColor="White" />
          <MajorTickMark LineColor="White" />
          <LabelStyle ForeColor="White" />
       </AxisY>
       <AxisX>
          <MajorGrid LineColor="White" />
          <MajorTickMark LineColor="White" />
          <LabelStyle ForeColor="White" />
       </AxisX>
   </asp:ChartArea>
</ChartAreas>

There are options for MajorGrid, MinorGrid and StripLines. The LabelStyle sets your text.

Upvotes: 2

Related Questions