is this impossible to have a style on the x-axis of a chart RRS feed

  • Question

  • Hello Experts;

    I have the following sample code below. I would like to add a few css style to the x-axis label of the chart. For instance, I would like to have a display block with a curved edge around the years in the chart. I have created stylesheet but I am not sure how to to apply it the chart directly.

    . So in my chart on the x-axis, there are the following years

    2014, 2015, 2016, 2017

    I would like to have a style around them and the style will be a rounded-edge block displaying the years.

    Thanks. All help is appreciated.

    <%@ Register Assembly="System.Web.DataVisualization, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>

    <style type="text/css">

    .hdesign {

    background-color: #000000;
    display: block;
    height: 14px;


    .curved_corners {
    /* border: 1px solid #A1DCF2;*/
    -webkit-border-radius: 0px 15px 0px 0px;
    -moz-border-radius: 0px 15px 0px 0px;
    border-radius:0px 15px 0px 0px;


    .curved_corners table table td {
    border-style: none;


    <asp:Chart ID="Chart3" runat="server" Width="750px">
    <asp:Series Name="Series1" ChartType="StackedBar" Color ="White" ></asp:Series>
    <asp:Series Name="Series2" ChartType="StackedBar" Color="Green" BorderColor="Black" ></asp:Series>
    <asp:ChartArea Name="ChartArea1">

    <MajorGrid Enabled="false" />
    <LabelStyle Format="yyyy" />
    <MajorGrid Enabled="false" />




    <add name="ChartImg" verb="*" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />


    private void plotgnatt()

    DataTable dt = cinfo.get_stations_info(1);
    Chart3.DataSource = dt;

    Chart3.Series["Series1"].XValueMember = "full_name"; 
    Chart3.Series["Series1"].YValueMembers = "begin_date";
    Chart3.Series["Series2"].XValueMember = "full_name";
    Chart3.Series["Series2"].YValueMembers = "duration_date_number";

    Chart3.ChartAreas[0].AxisY.Minimum = (new DateTime(2013, 1, 1)).ToOADate();
    Chart3.ChartAreas[0].AxisY.Maximum = (new DateTime(2023, 8, 1)).ToOADate();



    • Moved by CoolDadTx Monday, August 21, 2017 5:16 PM ASP.NET related
    Monday, August 21, 2017 4:48 PM

All replies