The WPF devexpress chart control has multiple y axes and specifies the Y axes for data reference.

Source: Internet
Author: User
When there are two or more y axes in the chart, we need to specify the Y axes corresponding to the column or line in the chart. At this time, we need to specify the column or line dxc: xydiagram2d. seriesaxisy attribute to set the corresponding Y axis (dxc: xydiagram2d. seriesaxisy = "{binding elementname = Y2}"). The elementname of binding is the name of the corresponding Y axis (Y2 here). The interface code is as follows:
<Dxc: chartcontrol datasource = "{binding saleamountanalysislist}"> <dxc: xydiagram2d X: Name = "diagram1" seriesdatamember = "gross"> <dxc: xydiagram2d. secondaryaxesy> <dxc: secondaryaxisy2d X: Name = "Y2"> <dxc: secondaryaxisy2d. title> <dxc: axistitle content = "()"> </dxc: axistitle> </dxc: secondaryaxisy2d. title> </dxc: secondaryaxisy2d> </dxc: xydiagram2d. secondaryaxesy> <dxc: xydiagram2d. axisy> <dxc: axisy2d X: Nam E = "firsty"> <dxc: axisy2d. title> <dxc: axistitle content = "()"/> </dxc: axisy2d. title> </dxc: axisy2d> </dxc: xydiagram2d. axisy> <dxc: xydiagram2d. axisx> <dxc: axisx2d/> </dxc: xydiagram2d. axisx> <! -- By default, the Y axis on the left is referenced. --> <! -- Sales commission --> <dxc: barsidebysideseries2d labelsvisibility = "true" argumentdatamember = "name" valuedatamember = "gross"> </dxc: barsidebysideseries2d> <! -- Average single gross profit --> <dxc: barsidebysideseries2d labelsvisibility = "true" argumentdatamember = "name" valuedatamember = "avegross"> </dxc: barsidebysideseries2d>! -- Contribute the gross profit by setting the dxc: xydiagram2d of lineseries2d. seriesaxisy to specify this line is referring to the Y axis on the right --> <dxc: lineseries2d labelsvisibility = "true" dxc: xydiagram2d. seriesaxisy = "{binding elementname = Y2}" argumentdatamember = "name" valuedatamember = "Roy"> </dxc: lineseries2d> </dxc: xydiagram2d> </dxc: chartcontrol>

The binding result of the code above is shown in:


The WPF devexpress chart control has multiple y axes and specifies the Y axes for data reference.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.