Hi ,
I have modify the acis set with this code on the fillscengraph :
// Create axes foreach (Primitive item in e.SceneGraph) { if (item.GetType() == typeof(Line) && ((Line)item).lineStyle.DrawStyle != LineDrawStyle.Dash) { if (((Line)item).p1.X == ((Line)item).p2.X) { ((Line)item).p1.Offset(this.Chartquadrant.Width / 2 - 50, 0); ((Line)item).p2.Offset(this.Chartquadrant.Width / 2 - 50, 0); } else { ((Line)item).p1.Offset(0, -360); ((Line)item).p2.Offset(0, -360); } } Text pl = item as Text; if (pl != null && ((Text)item).labelStyle.Orientation == TextOrientation.VerticalLeftFacing) { ((Text)item).bounds = new Rectangle(((Text)item).bounds.X + 0, ((Text)item).bounds.Y - (360), ((Text)item).bounds.Width, ((Text)item).bounds.Height); } if (pl != null && ((Text)item).labelStyle.Orientation == TextOrientation.Horizontal) { ((Text)item).bounds = new Rectangle(((Text)item).bounds.X + this.Chartquadrant.Width / 2 - 50, ((Text)item).bounds.Y, ((Text)item).bounds.Width, ((Text)item).bounds.Height); } }According to some sample I can put a text wherever I want on the graph by :
// name axes IAdvanceAxis xAxis = (IAdvanceAxis)e.Grid["X"]; IAdvanceAxis yAxis = (IAdvanceAxis)e.Grid["Y"]; if (xAxis == null || yAxis == null) return; Text text = new Text(); text.PE.Fill = Color.Red; text.bounds = new Rectangle((int)xAxis.Map(8), (int)yAxis.Map(10), 100, 20); text.SetTextString("Sample Text");
But the sample text is not visible, can you tell me what is wrong ?
Thanks
Hello Eltorfuerte,
I glad to see that you are using my suggestion to implement Cartesian Coordinate System. As you already know this is a custom solution, that`s why I'll log this "Product Idea" in to our insternal system. I have sent your idea directly to our product management team. Our product team chooses new ideas for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested features, we can plan accordingly. We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your idea is chosen for development, you will be notified at that time. Your reference number for this product idea is PI12100074. If you would like to follow up on your request at a later point, you may contact Developer Support management via email. Please include the reference number of your product idea in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com Thank you for your request.
Let`s take a look at your question:
Eltorfuerte said: But the sample text is not visible, can you tell me what is wrong ?
The mentioned behavior is expected, because the location of your "Sample Text" is determinate from Axis location in the chart. In our current scenario, we move our Y axis to right, it means that we also move our "Sample Text" to right and it is outside of the chart area, that`s why it is not visible. The mentioned code will works properly when we have not axis offset.
There are two possible approaches to solve this task.
Option 1: you could specify a new location of your Text Primitive, using the Bound() method
Option 2: You could use chart`s titles to achieve desired behavior instead of Text Primitive in FiilScenGraphe event. Here is a small example for this scenario:
ultraChart1.TitleBottom.Text = "My Axix";
ultraChart1.TitleBottom.Font = new System.Drawing.Font("Ariel", 12F);
ultraChart1.TitleBottom.FontColor = Color.Navy;
ultraChart1.TitleBottom.Visible = true;
ultraChart1.TitleBottom.HorizontalAlign = StringAlignment.Near;
Please let me know if you have any further questions.,
Regards
Hi Georgi,
Thanks for your mail.
I tried both options:
Options 1: I can't sitll see nothing, I think that this is because the IAdvanceAxis xAxis is always a null value.
Options 2: It works but I want to have the label next to the axis, so if it is possible to lift and shift it I will be happy.
This is the sample
Thanks Georgi , this works perfectly !
Additional question:
I don't know what will be the boundary of my graph before I plot it so how can I set the limits of my axis more dynamic ?
Hello eltorfuerte,
I`m not sure that I understand your question / scenario. Could you please try to explain more deeply.
Ok, If I plot something on your axis with let say the maximum point at y = 5 and the minimum point at y = -2 I will still see the scale of the Y axis from -50 to +50. Instead of that I want to see it from -10 to 10. So how to make the choice a the axis scale dynamic ?
Looking at the provided information, I suppose that somewhere in your code you are using these properties:
axisY.RangeType = AxisRangeType.Custom;
axisY.RangeMin = -50;
axisY.RangeMax = 50;
To acheive desired behavior you could try to set
axisY.RangeType = AxisRangeType.Automatic;
Let me know if you think that I misunderstand your scenario or if you have other questions.