I found the Problem.
To bring up the missing Axis you I had to add the Command CalculateMaxMinValues bevor plotting and updating the Graph:
GoalGraph.CalculateMaxMinValues();
GoalGraph.CurvePlotAll();
GoalGraph.Update();
Second issue in my code was, that I added the curves every time I called the PlotGoal function.
This has to be done just once.
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
- www.mql5.com
//| Expert initialization function | //| Expert deinitialization function | //| Expert tick function | //| test1 |...
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I want to create a small Chart showing the graph of a funktion. If I click on the chart, the chart should enlarge, to be able to see all details.
Creating the small chart works quite well:
Now I want to click on the chart to enlarge the chart.
Problem 1:
I can't find any posibility to resize the chart after I created it . Is there a possibilty to resize a CGraphic Chart?
Problem 2:
Then I tried to Destroy the small chart and to create a new larger chart with a different CGraphic object. If I do that. The small chart disapears and the large chart is displayed.
Again, if I click on the large Chart, the large chart disapears and the small chart will be displayed. But now without the Axis and I see two (same) graphs (I now it because, two lines are displayed):
My impression is, that if I use CGraphic.Destroy() the Axis aren't destroyed!?
Global Definition:
Function to draw om chart:
Code to Draw Chart:
One function is for the small chart (as shown below) and nearly the same function (PlotGoalLarge) just with different size parameters and the second CGraphic Object GoalGraphLarge .
(The "bSize" part is obsolete).
And the Code within the ChartEvent function to handle MouseClick Events:
Plese give me a hint how to resize a Chart Object (or how to properly Destroy a CGraphic Object).