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.