How to move the x-axis labels on a datetime scale further from the edges? - anychart

I have this chart: https://playground.anychart.com/D7okDBpO/2
I would like the plot and x-axis labels to have some padding from the left and right edges (one of the reasons is that the last x-label is not even fully visible right now), similarly to how a chart with ordinal scale is rendered. For the plot I managed to do this with:
series.left(30);
series.right(30);
But I can't find a solution for the x labels. What I've tried:
// This doesn't work because it moves both first and last label
chart.xAxis().labels().offsetX(-30);
// This doesn't work because it moves all the labels, even the ones in the middle
chart.xAxis().labels().padding().left(50);

are you looking for this setting:
chart.left(20);
chart.right(20);
https://playground.anychart.com/miB1VAbq ?

Related

How to hide axis bars in area chart and line chart in Google Data Studio

I currently have this issue where I am trying to hide the Y-axis of this line chart. Currently there is only the option to hide both axes in GDS.
Issue being is that the floating number at the y axis looks awkward.
Could anyone think of a work around? maybe hiding both axes and then creating a blank chart with the date values and using that as the x axis ticks.
One workaround is to draw a Shape or line over the axis and set it to a colour that blends in with the background, (although in the case above, it would cut into the first data point and data label) using Shift + movement keys for precision placement.
Google Data Studio Report as well as a GIF to elaborate:

Discover that a filled-in grid has a circle; fill in the area

Hi, I'm currently in the middle of a project where a new grid is added on to a chain of blocks on the grid every timestep. How would I be able to detect that a circle has been made in the grid? Given that all I have are the coordinates (x,y) and the color of each cell. By "circle" I mean an area that is sealed off, as shown in the picture.
Thanks in advance! By the way, I'm not asking how to click on a cell and apply the flood-fill algorithm.
The aftermath of the algorithm should produce this:
You need to split all of your white (unfilled) squares into sets of squares adjacent to each other. Start with any white square, add all of its unfilled adjacent squares to the set, and keep doing it until you've included all of the squares.
Once you have those sets, you will have a "circle" (as you named it) if there are non-empty sets that do not contain any border squares. Then to fill these sets you just change the color of each member to blue.
If you have the sets from the previous step, when you add another brick you just need to consider the set that included the affected square to see if it has been split into two sets and whether either of these new sets may be a "circle".

how to get slider line on x axis and y axis for Chart in codenameone

I want two slider lines - one for x-axis and another for y-axis to show accurate result at any point in the line chart. As slider line move through the any axis it should display the crossing point values (display cross point values w.r.t. axis where slider line overlaps graph ) on the chart. Is there any method available for it ? If not how do I proceed for this ?
You can just place a horizontal and vertical slider next to the charts. However, I'm assuming you want to use them like a scrollbar?
You might prefer using gestures like drag and pinch to work with charts.

JFreeChart: Logarithmic Axis Tick Labels missing

I am using JFreeChart to make XYLineCharts with a Logarithmic y-axis but am facing an issue that I am unable to resolve.
My x, y values are very low in some cases (in one such case, the y-axis values for the dataset range between 4.5e-8 to 1.7). I plot these values on a XYLineChart using a Logarithmic Axis for the y-axis (and using LogAxis.createLogTickUnits(Locale.ENGLISH) and .setExpTickLabelsFlag(true) on the y-axis to create the exponential tick units). I set my range's bounds from 4.5e-8 to 1.7 and can see the points plotted clearly but there are no tick labels visible for the y-axis !
I was earlier having this issue while zooming into the charts but I have fixed the zoom & AutoZoom by over-riding those methods.
My current LogarithmicAxis works well for most of my x, y datasets but in a few cases, the y-axis is plotted but does not show any Tick Labels on it, despite my creating them & setting their visibility to true.
If anyone has any suggestions on how to fix this & ensure that the Tick Labels are visible no matter what the y-axis values may be, please let me know soon as I need to get this done ASAP.
Thanks.

Silverlight toolkit chart too many labels on axis

I'm using the newest chart control from silverlight toolkit to plot some data. For small cases it works ok, but for bigger samples the X axis labels overlap. It would be no problem if the chart would simply omit some of the values or I could specify to just show every 10th of them ...
I couldn't find any properties providing this behavior. Any ideas?
Assuming this is a Linear axis then you can specify the interval to use via the the Interval property on the axis.
If the axis in question is Category Axis then dropping some labels may not be valuable to the user. One option is to use the LayoutTransfomer to rotate the labels to an angle reducing the width needed for each one. See this Delay Blog on the subject.

Resources