How to create a line chart using JFreeChart? - jfreechart

I am trying to create a line chart in my app for the first time which is going to show the trend of stock prices in my portfolio during the last five years. So I have time(year) in the horizontal line and the price in the vertical line.
I am looking for a brief example similar to my case to go through it and implement mine. Does anybody know a similar example?

Related

Drawing a bar chart in the background of candlestick chart in apexchart

I am playing with candlestick graphs (example from here: https://apexcharts.com/javascript-chart-demos/candlestick-charts/basic/) everything work as expected.
However, I am struggling with adding my signal data for a visual representation of the graph.
I am unable to find a solution that works I was thinking I can somehow fine-tune a timeline - I tried chart.js/apexcharts and for now, I believe the closest will be with the second framework.
What I need is a bar chart that can be used in numeric ranges for the X and Y-axis as presented below. (the goal is to be able to add the green bar as presented)
Is there an easy win or an idea of how to approach this?
Is there something I am missing?
That is my current solution (line graphs with stopWin/stopLose and entry price).
Still suboptimal - but works and is easy to achieve.
After weeks of playing around with it - the solution stayed:
I got two instances of apexcharts one with candlestick and one with line graphs
they are in a single div with CSS playground and position absolute.
I am passing standardised min/max values and has to have the same amount of elements in them (line graphs are allowing You to add null values which allow using this solution.
The final version work is repeatable and looks good.
if you need some help in similar case - feel free to reach out ;)

Curved Line Charts

Is it possible to make the set the line charts to have curvature instead of straight lines?
I'm trying to get the desired curved line like the picture below.
It's impossible right now, but there is an issue for that https://github.com/tradingview/lightweight-charts/issues/506, so you can subscribe on it and/or provide additional information to the issue.

google-data-studio grouping most values of dimensions into others category

I am using Data-Studio to generate charts. I am generating charts for compute instances based on their CPU usage,in time-series. When I generate a chart(a line chart) a few instances are represented as lines in the chart, which have specific CPU usage values, but the majority of instances get accumulated into a category called "others" and therefore I am unable to show the metrics for others and the chart is not very useful.
Is there any way this category others can be avoided in data studio? so that all the instances are represented by a line or a bar?
I am new to Data-Studio. Kindly help. Thanks
There are a couple of ways to display the chart Without the Others series:
1) Time Series Chart
If you are using Date in the X-Axis (Dimension) then I'd suggest a Time Series chart as it's designed for Dates, and automatically sorts by Date as well as allowing for Date Range comparison (it also don't display the Others series, and series can be displayed as a line or bar).
2) Line Chart
Regarding the initial question (Line Chart) - Tested this out in a number of different Reports and Data Sources to confirm, and it seems to do the trick:
Create a Time Series chart;
Change the Chart Type to a Line chart;
Sort by Date in Ascending order.
Google Data Studio Report and a GIF to elaborate:

Mixed markers on the same Oxyplot line?

I have a plot where three lines are shown. Each line has a marker that identifies its type.
The user can choose a type of line and click on the plot to create those lines.
No problems this far.
The problem is that i need one of those lines to have two distinct types of markers, for example, the user can right click somewhere on the plot, which will open a context menu and choose one option that would create a point with a special marker for that line. The question is: is it possible to mix markers on the same LineSeries? If the answer is yes, how can I do that?
Thank you.
I'm not sure it qualifies as a data series, if it has different markers. I think you need to keep a line series showing the line and muliple line series showing the different markers. You then need to sync all the series when adding a point.

Has anyone ever used a graph like this with Reactjs?

I want to visualize a data using graph, this is the sample graph that i want to use it.
I think the picture above is like time series graph types, data on the graph shows a random numbers in variety of time. If every data number is null or empty the graph is painting a full vertical red line.
My goal is to visualize a data like picture above, i already tried to use a different reactjs chart to visualize a data but can't
make if every data number is null or empty the graph is painting a full vertical red line like the picture.
Has anyone ever used a chart like the picture above?
It is better if you try Recharts. It is a compo-sable charting library for react components.

Resources