Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Stack3DColumnChart Positive and Negative Values
posted

I'm working on a Stack3DColumnChart but it is given me an error 'Staked Column 3D chart'. Error You must have at least one row and one numeric column and data should be either all positive or negative. 

How can i make to display +- values in Charts? 

Thanks

Parents
No Data
Reply
  • 10685
    Offline posted

    Hello,

    Thank you for posting in our community!

    When working with charts, each one has a specific requirements defining what Chart Data to be used. For a 3D Stacked Column chart, the minimum number and rows are 1 numeric column with all-positive or all-negative values, as per the error message. You will find some more details regarding rows and columns as well as a Data example here.

    For example, the DataSource could look something similar to the following, where the DataSource contains 4 Columns and 5 Rows:

    protected void Page_Load(object sender, EventArgs e)
    {
    this.UltraChart1.DataSource = GetData();
    this.UltraChart1.DataBind();
    }

    private DataTable GetData()
    {
    DataTable mydata = new DataTable();
    // Define the columns and their names
    mydata.Columns.Add("Series Label", typeof(string));
    mydata.Columns.Add("Segment A", typeof(int));
    mydata.Columns.Add("Segment B", typeof(int));
    mydata.Columns.Add("Segment C", typeof(int));

    // Add the rows of data
    mydata.Rows.Add(new Object[] { "Stack A", 8, 11, 14 });
    mydata.Rows.Add(new Object[] { "Stack B", 4, 11, 16 });
    mydata.Rows.Add(new Object[] { "Stack C", 3, 11, 18 });
    mydata.Rows.Add(new Object[] { "Stack D", 3, 11, 12 });
    mydata.Rows.Add(new Object[] { "Stack E", 3, 11, 16 });
    return mydata;
    }

     

    In case you are interested, here you will find several online samples illustrating Stacked Column Chart and Stacked 3D Bar/Column Chart

Children
No Data