MS Chart.NET - how to control Axis Interval in Auto mode? - intervals

this probably has been asked before, but I was unable to find a satisfying answer. I am using MS Chart .Net (3.5) control on an ASP.NET page. I'd like to keep AxisX and AxisY in Auto mode - when interval is large and the Axis labels are like "0,5,10,15.." or "0,100,200,300.." it's fine. But when difference between Min and Max values is small - Auto Mode switches to fractions e.g. "0, 0.5, 1, 1.5 .." etc.
My question is: How do I keep interval in Auto mode, but make the minimum "tick" as 1?
Thanks!

Related

How to auto scale Y-values for a DateTime series within a zoomed in X boundaries?

I am writing an application for Windows 10 using Delphi 11 and Steema TeeChart pro 11 components.
I use AddXY(….) to plot a DateTime series of about 1000 values as points in Chart1 with BottomAxis set to DateTime and the Leftaxis set to float.
Thereafter I zoom in a small part of the data in Chart1 using the mouse wheel or drawing a rectangle.
Then I want to plot a new time series (AddXY(….)) of 1000 values in Chart1, keeping the zoomed in min and max values for the bottom axes, but use automatic scaling for LeftAxis. Before plotting the second series I delete the first.
The second series have the same DateTime values as the first series, but the Y values are sometimes very different compared with the first series and may not be visible in the graph.
Now the problem occurs. The Left axis will be automatic scaled based on all the data points and not on the points only falling within the zoomed X boundaries.
Does TChart have a simple method to find the min and max Y-values for the second series within the zoomed in time period. I thought of using the LeftAxis.AdjustMinMax() procedure for rescaling the left axis?
Of course I could scan through all the Y-values within the zoomed in period and calculate the min and max value. Then, how do I know the starting and ending valueindex of the data points falling within the zoomed in time period? I hoped to avoid using this method due to speed resons if number of points are > 1000.
Hopefully someone more experienced TeeChart programmer than I am can give me some suggestions of the best way to achieve this.

Get a minimum value between view high and view width

I'm fairly new to scss, I'm trying to make a variable that has the minimum value of 10 percent view height and 10 percent view width.
my approach is
$size = min(10vh, 10vw);
But I would get unit not comparable error.
How would I solve such issue? Thanks in advance
I think that this can't be done.
At transpile time SASS doesn't know what the height and the width of the viewport are gonna be (think about the change of orientation of a tablet). That information is only available on the client device.
This can't be done in CSS either (there is no max or min function), see Calc of max, or max of calc in CSS

dimple.js - keeping scale after reloading new data

In d3.js I can load a dataset and filter it on 'year'. This opproach gives me the possibility to calculate my d3 scales and vertical axis based on my complete dataset's max y value.
My aim is to get the graph to be visually comparable when changing view from one year to another. - With the same maxscale value, and the same relative vertical height per unit in the columns after reloading data for another year.
Do anybody know how to accomplish this in dimple.js?
Thanks :)
In the documentation there are some examples of what you're trying to achieve..
Namely, one in which the axis min and max settings are manually set..
// Setting min and max dates requires them to be set
// as actual javascript date objects
y.overrideMin = new Date("01/01/2000 9:00 am");
y.overrideMax = new Date("01/01/2000 6:00 pm");
In this case they are Time values for a day, which make sense not to change, but the same should apply.. But, you should give us some of your code examples for more specific answers.
So from chart change to chart change, you will retain the same Min & Max as the previous year.
Reference DimpleJS Advanced Time Axis

Gradually move from one color to another

I have a program where I have a slider, and when i move it up or down (left or right) the color changes gradually. Sadly I am not able to achieve this. My colors change yes, but it is very sudden! I have the 7 colors of the rainbow on seperate .png files and when I scroll the respective one comes up. I was wondering if there was anything I could do to make the colors morph or blend into each other better to make the transaction appear muuch more smoothly.
Thank you
UPDATE
if(self.slider.value > 7 (
{
self.label.text=#"red";
//self.imgView.backgroundColor=[UIColor redColor];
// self.imgView.backgroundColor=[UIColor colorWithPatternImage:#"redPicture"];
self.view.backgroundColor=[UIColor colorWithRed:146 green:50 blue:146 alpha:1];
}
This is going to be a generalized answer because I'm not going to write your code for you (not least because I have never written a letter of xcode in my life), but this should put you on the right track.
You want a continuous spectrum of color, so that should tell you right off the bat that using a series of if statements is the wrong way to go. Instead, you should calculate the color you want by doing some math with the slider value directly.
You haven't told me what your slider range is and whether it's discrete, so for the purposes of this answer let's call the lowest value min and the highest value max, just to keep things general. So your total range is max - min. Let's express the value of your slider as a percentage along this range; we can calculate this as (self.slider.value - min) / (max - min). (For instance, for a slider that goes from 0 to 50, a slider value of 37 gives you (37-0)/(50-0) = 0.74.)
So now you should have a decimal value between 0 and 1, which you can map along the Hue-Saturation-Value color scale. I don't know if xcode has a HSV method directly (this answer has some code which might be helpful), but if not it's pretty easy to convert HSV to RGB.

Graph in chart with x without limits

I have defined a chart on a form, as you are entering the data the chart gets smaller.
Is there any way to make it pass the data as an infinite tape, doing that all entries completed within the limits of chart?
y as any series of numbers, in this case is electric current
x are time in seconds
I need the x pass continuously, not acumulative from the y and x = 0
Get the Visual Studio 2010 "WinFormsChartSamples" at Microsoft's web page Samples Environment for .NET Framework 4 Chart Controls Released!
In the example charts, there are live signal-type and time-series charts which show the real-time signal move to the left as the data are fed to the chart. Also, several speed options are available.

Resources