0

My question is: How can I change the normal graph(left one) to the graph I want(right one)? I cant find it anywhere.

enter image description here

enter image description here

I want the full yellow square to be 1,1. How can I see the BackImage size so I can make the background image compatible? I only want the graph size not the actual chart.

TaW
  • 53,122
  • 8
  • 69
  • 111

1 Answers1

0
  • You need to reverse the Y-Axis

yourChart.Chartareas[0].AxisY.IsReversed = true;
  • Your other question is just as simple: You can set an BackImage for your ChartArea and if you set the BackImageWrapMode = ChartImageWrapMode.Scaled it will always nicely fill the ChartArea even when you resize the chart or when the Labels or the Legend grows or shrinks..
TaW
  • 53,122
  • 8
  • 69
  • 111
  • perfect. Do you also know the answer to my 2nd question? I wanted to align each square to a position. Like full yellow square to 1,1 ,etc... – Maurício Vilarinho Nov 09 '16 at 20:30
  • For this I would need to know much more about how the chart is created. Please add to your question! – TaW Nov 09 '16 at 20:32
  • Maybe if I know the graph area I can make a equal size image on photoshop so I can represent what I want. – Maurício Vilarinho Nov 09 '16 at 20:33
  • Is there a way I can talk to you? Like a chat or something? thx – Maurício Vilarinho Nov 09 '16 at 20:34
  • Can't say I quite understand; you can try but, yes maybe this would help? You can set the BackgroundImage and its Alignment.. - Um no, not until you gain a little more reps.. – TaW Nov 09 '16 at 20:35
  • The problem is that the image is not the size of the actual graph so the squares are not on the right x,y position – Maurício Vilarinho Nov 09 '16 at 20:37
  • If I make an image with the exact size of the graph maybe I can do it. Without neededing to use "scaled". – Maurício Vilarinho Nov 09 '16 at 20:37
  • That's why I wanted to know how can I get the actual graph width and height. Not the chart. – Maurício Vilarinho Nov 09 '16 at 20:39
  • 2
    @MaurícioVilarinho your question is answered with a correct answer. Avoid chatting in the comment section. If you run into another issue (hopefully **after trying yourself first**). You can make a new question regarding the problem/issue you are having. – Jim Nov 09 '16 at 20:40
  • Yes; you need to set the BachgroundImageLayout to stretch. You can get the pixels from chart.ClientSize but the actual [inner plotposition rectangle](http://stackoverflow.com/questions/7040569/convert-chart-coords-to-pixels/38461385?s=1|0.1564#38461385) is smaller – TaW Nov 09 '16 at 20:40
  • Yes, you must not take it directly as it is set to Auto (0,0) and also is in percantages!!. Use the function(s) found in the link instead!! And call them __after__ the chart is done with its layout! - But I'm not sure the resizing will stay in synch.. If it doesn't you would have to create an adapted image on the fly. Well worth of another question if your attempts fail. Do try first!! – TaW Nov 09 '16 at 21:07
  • After coding it I found that you can simply set an image for each Chartarea :-) See my update! – TaW Nov 09 '16 at 21:38