web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Stacked chart of Won vs Lost revenue - Chart problem

(0) ShareShare
ReportReport
Posted on by

Hi,

I'm following the example here to make a stacked chart showing won vs lost revenue amounts for opportunities. It's not working...

For example, I want to show two columns, one for Won, one for Lost - but the chart interprets this as wanting two Y-axis's. I want only the one on the left. Yes, when I exported the XML, I removed the second YAxis in the ChartArea section. When I re-imported it, this is what I saw... still two Y Axis's.

My chart XML is attached.. anyone understand why the second y-axis is there on the right? I would also settle for one column as the example had.

Thanks,

Paul

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Stacked chart of Won vs Lost revenue - Chart problem

    Ahh, perfect. That worked. Thanks!

  • Verified answer
    Mamatha Swamy Profile Picture
    5,426 on at
    RE: Stacked chart of Won vs Lost revenue - Chart problem

    You don't need to edit the XML to get a chart as I had posted. You can create a simple chart by choosing Actual and Estimated revenue fields as Series and Customer as Category. Alternatively you can modify an existing chart

    1. Open the default "Deals Won vs. Deals Lost By Owner" Chart and Save as "Deals Won vs. Deals Lost By Customer"

    Solution-> Entity -> Opportunity ->Charts

    2. Change the Horizontal axis field from Owner to PotentialCustomer. Choose appropriate view for your requirement.

  • Community Member Profile Picture
    on at
    RE: Stacked chart of Won vs Lost revenue - Chart problem

    Right.. I don't need aggregates at the moment since they can just hover over to see those values.

    I followed Adam's advice and removed the YAxis="Secondary" component and my graph now looks like this.

    So I want it to look like Mamatha's picture, which it now does not. Also, the graph is wrong... I had one oppty with $133k *won* and one with $4k lost. Yet the red part (Loser) is amounting to $133k and the winner is $4k, so its backwards.

    Here is my XML, any help appreciated. Thanks.

    <visualization>
    <visualizationid>{B35583E8-96DF-E411-80D6-C4346BACC97C}</visualizationid>
    <name>MN Opportunities - Won vs Lost</name>
    <primaryentitytypecode>opportunity</primaryentitytypecode>
    <datadescription>
    <datadefinition>
    <fetchcollection>
    <fetch mapping="logical" aggregate="true">
    <entity name="opportunity">
    <attribute groupby="true" alias="wonvlost" name="customerid" />
    <link-entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer">
    <attribute alias="won" name="actualvalue" aggregate="sum" />
    <filter>
    <condition attribute="statecode" operator="eq" value="Won" />
    </filter>
    </link-entity>
    <link-entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer">
    <attribute alias="lost" name="actualvalue" aggregate="sum" />
    <filter>
    <condition attribute="statecode" operator="eq" value="Lost" />
    </filter>
    </link-entity>
    </entity>
    </fetch>
    </fetchcollection>
    <categorycollection>
    <category alias="wonvlost">
    <measurecollection>
    <measure alias="won" />
    </measurecollection>
    <measurecollection>
    <measure alias="lost" />
    </measurecollection>
    </category>
    </categorycollection>
    </datadefinition>
    </datadescription>
    <presentationdescription>
    <Chart Palette="None" PaletteCustomColors="91,151,213; 237,125,49; 160,116,166; 255,192,0; 68,114,196; 112,173,71; 37,94,145; 158,72,14; 117,55,125; 153,115,0; 38,68,120; 67,104,43; 124,175,221; 241,151,90; 186,144,192; 255,205,51; 105,142,208; 140,193,104; 50,125,194; 210,96,18; 150,83,159; 204,154,0; 51,90,161; 90,138,57;">
    <Series>
    <Series ChartType="StackedColumn" LegendText="Loser" Color="red" IsValueShownAsLabel="False" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
    <Series ChartType="StackedColumn" LegendText="winner" Color="blue" IsValueShownAsLabel="False" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
    </Series>
    <ChartAreas>
    <ChartArea BorderColor="White" BorderDashStyle="Solid">
    <AxisY LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount">
    <MajorGrid LineColor="239, 242, 246" />
    <MajorTickMark LineColor="165, 172, 181" />
    <LabelStyle Font="{0}, 10.5px" Format="$#,#,k" ForeColor="59, 59, 59" />
    </AxisY>
    <AxisX LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount">
    <MajorTickMark LineColor="165, 172, 181" />
    <MajorGrid LineColor="Transparent" />
    <LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" />
    </AxisX>
    </ChartArea>
    </ChartAreas>
    <Titles>
    <Title Alignment="TopLeft" DockingOffset="-3" Font="{0}, 13px" ForeColor="59, 59, 59"></Title>
    </Titles>
    <Legends>
    <Legend Alignment="Center" LegendStyle="Table" Docking="right" IsEquallySpacedItems="True" LegendItemOrder="ReversedSeriesOrder" Font="{0}, 11px" ShadowColor="0, 0, 0, 0" ForeColor="59, 59, 59" />
    </Legends>
    </Chart>
    </presentationdescription>
    <isdefault>false</isdefault>
    </visualization>

  • Community Member Profile Picture
    on at
    RE: Stacked chart of Won vs Lost revenue - Chart problem

    Do you want the columns to be stacked, or side-by-side (sometimes called "clustered" columns)?

    If you want them side by side then you don't need anything fancy, just start again and add one category for customer and a second category for status.

    If for some reason you want to use flitering (such as filtering on status reason so you can ignore some types of lost/cancelled but include lost/out-sold), then you do need to add the series twice and then edit the XML to do custom filtering.

    I can't see where you have attached your XML, maybe you could post it inline?

    To remove the rogue secondary axis, you need to remove the <AxisY2>section, but also in the Series definition remove the YAxisType="Secondary"

  • Suggested answer
    Mamatha Swamy Profile Picture
    5,426 on at
    RE: Stacked chart of Won vs Lost revenue - Chart problem

    Do you need aggregates to be shown on top of the bars? Does the below suffice?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
Christoph Pock Profile Picture

Christoph Pock 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans