The font size of chart on android device is different from on iOS device and on Simulator - codenameone

This issue happens on the pie charts, time series charts, and line charts. I have an example on the pie chart.
I have a medium font declared as follows:
public static Font medFont = Font.createTrueTypeFont("Noto Sans CJK TC Light", "Noto Sans CJK TC Light.ttf").derive(36f, Style.UNIT_TYPE_DIPS);
And set the label of the pie chart as follows:
renderer.setLabelsTextSize(medFont.getHeight()/2);
the pie chart on the simulator with Samsung Galaxy s7 Skin
the pie chart on an iOS device - iPhone 7 plus
the pie char on an Android device -Samsung A31

Related

How responsive works?

Why we have breakpoints for 400px or 600px, for example?
These breakpoints are verifying the resolution of the device, but now smartphones have resolutions such as Full HD (1920 x 1080 ) or 2k (2560 × 1440). That's why I'm confused. Why do I have to use breakpoints for smartphones with 400px - 600px if now most of them have 1080px - 1440px?
I have a 1080 x 2340 pixel device, but my webpage looks like it's 500px wide
The pixels we define in breakpoints refer to the viewport size of the device, while the pixels defined in a device's screen resolution refer to the number of physical pixels that device has. Viewport size exist to compensate the difference in screen sizes of different devices.
This unit of measurement is sometimes referred to as “device independent pixels” or “CSS pixels”.
For instance, a laptop and a smartphone, both with a screen resolution of 1920x1080. If the screen of the two devices are treated the same way because their screen resolution is the same, the same content (let's say a 1200x1200 image) displayed on both device would look fairly large on the laptop but would look very small on the smartphone because even though they have the same screen resolution, their screen sizes are very different. But with viewport size, the same content can be scaled depending on the device's screen size.
You can read more about this topic in Difference Between Viewport, Screen Resolution, DPR, and PPI for Responsive Web Development.
Hope this information answers your question.

Touch coordinates on mobile and desktop

I'm trying to create a spot the difference game that will work on desktop and mobile and am having problems finding the coordinates on the image the player touched when using a mobile.
The game is fluid on the mobile, so the images automatically resize to fill the available screen.
I'm using this code to detect mouse position:
$(document).on("click",".image-wrapper",function(e){
var coordX = e.pageX - $(this).offset().left;
var coordY = e.pageY - $(this).offset().top;
alert (coordX + ', ' + coordY);
}
The code works great on desktop, but when I try it on mobile, it gives different results.
The image dimensions are 368px x 550px.
If I touch the image at the top, the coordinates I see are the same as the desktop.
However, if I touch half way down the image, the vertical coordinate shows about 60 pixels more than the desktop and if I touch at the bottom of the image, the vertical coordinate shows about 120 pixels more than the desktop.
Is there a way to get reliable coordinates on all devices?
My spot the difference game will be pretty useless otherwise :(

Is it possible to zoom in a Shield UI Pie Chart?

Why can’t I zoom in a Shield UI Pie Chart? Are there any settings to be enabled? I tried the
zoomMode: 'xy',
property, with no success.
You can’t zoom in on a pie chart. Nor do I see any need to. The only case you might need to do that is if the size of the pie is misset and it is bigger than the chart’s plot. Even if there was some possibility it would be resizing, and not zooming, since all the data is visible constantly.

can we use jfreechart to display an image

Is there anyway to use jfreechart to load and display an image? say some image.png to display on a JPanel using jfreechart so that we can zoomin, zoomout etc?
The ChartPanel class provided in the JFreeChart distribution is the recommmended mechanism for displaying charts in a Swing user interface.

3D chart in silverlight4

how to create 3D pie chart using silverlight 4 toolkit
Unfortunately the Silverlight Toolkit does not support 3D pie charts.
From a data visualisation point of view, I would advise you to avoid using them at all! Pie charts are problematic for a variety of reasons. I would advise having a quick read of Stephen Few's essay "Save the pies for dessert!" as to why pie charts, and more specifically 3d charts, are not recommended for most contexts.
Visiblox Charts has 2D pie charts. It is available as a free download so you won't need to buy the component, unless you want to remove the watermark. 3D charts, as Sam Hogarth says, are generally not the best way to display information.
The Silverlight 4 Toolkit doesn't do 3D charts. It will take more than just styling to create a 3D pie chart you would need to create a new data series type.
I hate giving these sorts of answers but the bottom line is, if really must have a 3D Chart buy a component that does it, there aren't any free ones (that I know of).
As others have said, The SL4 Toolkit doesn't have any 3D Charts. But Telerik does. They have a wide variety of 3D Charts that you can review at the links provided below:
Bar Charts
3D Bar , 3D Stacked Bar , 3D Stacked Bar 100 Series
Line Charts
3DLine, 3D Stacked Line
Area Charts
3D Area , 3D Stacked Area , 3D Stacked Area 100 Series
Pie Charts
3D Doughnut , 3D Pie
Disclaimer: I work at Telerik as a XAML Evangelist.

Resources