TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
-
Sandra
- Site Admin
- Posts: 3132
- Joined: Fri Nov 07, 2008 12:00 am
Post
by Sandra » Tue Dec 14, 2010 3:36 pm
Hello Venu,
Try to change property of labels of Axes, DateTimeFormat as do in next lines:
Code: Select all
webChart1.Chart.Axes.Bottom.Labels.DateTimeFormat = "MM/dd hh:mm";
webCahrt1.Chart.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneDay);
webChart1.Chart.Axes.Bottom.Labels.Angle = 90;
Could you tell us if previous lines of code solve your problem?
I hope will helps.
Thanks,
-
HitachiSteema
- Newbie
- Posts: 13
- Joined: Mon Aug 09, 2010 12:00 am
-
Contact:
Post
by HitachiSteema » Tue Dec 14, 2010 8:09 pm
Hi Sandra,
Thanks for your reply. I already tried setting the dateTime format string but it displays the date as follows
11/21/2010 12:00:00 AM
11/21/2010 12:00:00 PM
11/22/2010 12:00:00 AM
11/22/2010 12:00:00 PM......as follows
I have a DateTime variable which has both date and time value in it.
code snippet
ltTrend is the line series chart
ltd.DETMEDIANTREND.STORETS - datetime type( this has both date & time value I want to display this exact value in the bottom axis. I dont want to use any Enumerabels like DateTimeSteps)
ltd.DETMEDIANTREND.MEDIALLT - double type
ltTrend.Series[0].Add(ltd.DETMEDIANTREND.STORETS, ltd.DETMEDIANTREND.MEDIALLT);
ltTrend.Series[0].XValues.DateTime = true;
see the atachtment for reference.
Thanks,Venu
-
Attachments
-
- DateTime-BottomAxis.PNG (228.32 KiB) Viewed 15782 times
-
Sandra
- Site Admin
- Posts: 3132
- Joined: Fri Nov 07, 2008 12:00 am
Post
by Sandra » Thu Dec 16, 2010 11:48 am
Hello Venu,
Ok.I recommend that customize labels of bottom axis as do in next example:
Code: Select all
{
InitializeChart();
}
Steema.TeeChart.Styles.Line Series1;
Steema.TeeChart.Tools.ZoomTool tool1;
System.IO.MemoryStream tmpChart;
protected void InitializeChart()
{
Steema.TeeChart.Chart ch1;// = WebChart1.Chart;
tmpChart = new System.IO.MemoryStream();
if (Session["ch1"] == null)
{
ch1 = WebChart1.Chart;
tool1 = new Steema.TeeChart.Tools.ZoomTool(WebChart1.Chart);
tool1.ZoomPenColor = System.Drawing.Color.OliveDrab;
ch1.Panel.Gradient.Visible = false;
ch1.Walls.Visible = false;
Series1 = new Steema.TeeChart.Styles.Line(ch1);
Random rnd = new Random();
DateTime today = DateTime.Today;
TimeSpan oneDay = TimeSpan.FromMinutes(30);
Series1.XValues.DateTime = true;
for (int i = 0; i < 10; ++i)
{
Series1.Add(today, rnd.Next(100), System.Drawing.Color.Red);
today += oneDay;
}
ch1.Axes.Bottom.Labels.Items.Clear();
for (int j = 0; j < Series1.Count; j++)
{
ch1.Axes.Bottom.Labels.Items.Add(Series1.XValues[j], DateTime.FromOADate(Series1.XValues[j]).ToString());
}
ch1.Axes.Bottom.Labels.Angle = 90;
ch1.Export.Template.Save(tmpChart);
//save template to a Session variable
Session.Add("ch1", tmpChart);
}
else
{
//retrieve the session stored Chart
tmpChart = (System.IO.MemoryStream)Session["ch1"];
//set the Stream position to 0 as the last read/write
//will have moved the position to the end of the stream
tmpChart.Position = 0;
//import saved Chart
WebChart1.Chart.Import.Template.Load(tmpChart);
WebChart1.Chart.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.ThirtyMinutes);
CheckZoom(WebChart1);
}
}
private void CheckZoom(Steema.TeeChart.Web.WebChart wChart)
{
System.Collections.ArrayList zoomedState = (System.Collections.ArrayList)Session[wChart.ID + "Zoomed"];
zoomedState = ((Steema.TeeChart.Tools.ZoomTool)wChart.Chart.Tools[0]).SetCurrentZoom(Request,
zoomedState);
// System.Drawing.Bitmap bmp = WebChart1.Chart.Bitmap((int)wChart.Width.Value, (int)wChart.Height.Value);
if (zoomedState == null)
{
Session.Remove(wChart.ID + "Zoomed");
}
else
{
Session.Add(wChart.ID + "Zoomed", zoomedState);
}
}
If previous code doesn't work as you like, let me know.
I hope will helps.
Thanks,
-
Captell
- Newbie
- Posts: 65
- Joined: Fri Sep 18, 2009 12:00 am
Post
by Captell » Thu Dec 23, 2010 6:49 am
Hi All,
I'm interested in the resolution to the legend checkbox issue. A couple of my clients are having problems with this and would like to be able to toggle series on and off in the legend. Sandra, you mentioned that this would be fixed soon, any update on when it is likely to be resolved? I don't want to implement custom code to resolve this issue if it is going to be resolved in the component by you guys soon.
Thanks.
Adrian.
-
Sandra
- Site Admin
- Posts: 3132
- Joined: Fri Nov 07, 2008 12:00 am
Post
by Sandra » Mon Jan 10, 2011 5:12 pm
Hello Captell,
Sorry for the delay, but we are doing many test about this item and we have to evaluate if the solutions we have achieved are the best to inclusion in next maintenance release of TeeChart.Net, we are preparing.
When we will achieve implement a good solution to item of check boxes we inform you immediately in this thread.
Thanks,
-
Captell
- Newbie
- Posts: 65
- Joined: Fri Sep 18, 2009 12:00 am
Post
by Captell » Mon Jan 10, 2011 8:28 pm
Thanks for the update, I'm looking forward to a resolution to this issue in a near future release.
-
HitachiSteema
- Newbie
- Posts: 13
- Joined: Mon Aug 09, 2010 12:00 am
-
Contact:
Post
by HitachiSteema » Mon Feb 07, 2011 10:12 pm
Hi Sandra,
Sry for the long delay. I was into another work which made me not to work on the issue which I reported for few days.I am back into this issue and it seems many of them want this legend toggle as well as the previous issue which needs be working in the .net tee chart version. So please let us know when can we expect the solution.
Thanks,Venu
-
HitachiSteema
- Newbie
- Posts: 13
- Joined: Mon Aug 09, 2010 12:00 am
-
Contact:
Post
by HitachiSteema » Mon Feb 07, 2011 10:49 pm
Hi Steema Team,
I would like to post a question on .net tee chart series collection.
I have a tee chart in a asp.net web page with 5 line series on it. I also have other standarad asp controls on the web page with its Autopostback property enabled. I also have few Ajax controls which also has the Autopostback enabled.
In the Page_load function I have initialized the tee chart with an variable like
WebChart1 is the id of the tee chart on the aspx page (<tchart:webchart id="WebChart1">
Steema.TeeChart.Chart t1 = new Steema.TeeChart.Chart()
Protected Page_Load(object sender, Eventargs e)
{
t1 = WebChart1.Chart;
}
if I am not doing this initialize on the page_load I am unable to use the tee chart series as the series collection count is set to zero. So for each control since the Autopostback is set to true the page_load gets called and the t1 is keep initalizing everytime with series collection. if this is not happening the series collection count is set to zero. Why this is happening.
I tried using the Cache to store the teechat object at the time of initialization but when I try to reuse it the series collection count is set to zero.
I dont want to use the Session as I am suing WebMethods in asp.net to call the server side function in the client script.
Say for e.g
Now I have a external .js file which creates has a input tag of type button like below
<input type="button" runat="server" value="submit" style="width:116pt; height:23pt; border:none; background: transparent url(Copy of Exportout_.PNG) no-repeat center center; " id="btnclick" onclick="submitclick();" />
in the SubmitClick funstion I call a server side function and I tried to reuse the Cache variable. the object is still alive and has all other attribute values but when I see the series collection count it is set to zero and because of this I am not able to use plot the tee chart with the values.
Can you please help me on it..
Thanks,Venu
-
Sandra
- Site Admin
- Posts: 3132
- Joined: Fri Nov 07, 2008 12:00 am
Post
by Sandra » Thu Feb 10, 2011 11:41 am
Hello Venu,
Sorry for the delay. Could you please try to arrange a simple example project we can run as-is to reproduce the problem here? So we can help you to solve your problem
Thanks,
-
HitachiSteema
- Newbie
- Posts: 13
- Joined: Mon Aug 09, 2010 12:00 am
-
Contact:
Post
by HitachiSteema » Tue Mar 08, 2011 12:11 am
Hi Sandra,
Thanks. I solved the last posted question. I and everyone need to get solution on the question I posted earlier on the legend box enable/disable should add/remove the series in the web chart.
When can we get the solution?
Thanks,Venu
-
Sandra
- Site Admin
- Posts: 3132
- Joined: Fri Nov 07, 2008 12:00 am
Post
by Sandra » Fri Mar 11, 2011 12:41 pm
Hello Venu,
Sorry for the delay. At the moment, I can't still provide an estimate date. We have made many tests but seems behavior of checkboxes it still is not quite good. When we will achieve implement a good solution to item of check boxes we inform you immediately in this thread.
Moreover, I recommend you to be aware at this forums board, our
RSS news feed,
twitter or
facebook accounts for new release announcements and what's implemented on them.
Thanks,
-
Marc
- Site Admin
- Posts: 1272
- Joined: Thu Oct 16, 2003 4:00 am
- Location: Girona
-
Contact:
Post
by Marc » Wed Jun 11, 2014 2:28 pm
Steema Support