Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to customize the histogram of a graph by Qt

Shulou Source: shulou.com Published: 2022-06-01 13:07:26 10月01日 Update

This article mainly explains the "Qt how to customize the graph bar chart", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Qt how to customize the curve bar chart" bar!

I. functional features

You can set the X-axis Y-axis range value.

You can set the background color + text color + grid color.

Can set whether to display positioning crosshairs, can be set horizontally and vertically respectively.

The width and color of the crosshair can be set.

You can set whether to fill the background to form an area map.

Can be set mode-drag + zoom and so on.

The distance between axes can be set + the second coordinate system is visible.

Provides the interface setDataBar to directly set the bar chart to support multiple stacking charts.

Provides interface setLabs to set text labels instead of key, including X-axis and Y-axis.

Provide emptying the data + redrawing the chart + getting QCustomPlot objects externally, so that more detailed parameter settings can be made.

Provides the function start+stop to simulate the sine curve.

The position + accuracy + color of the value of the bar chart can be set.

Support the mouse to move to the data point to highlight the data point and display the data prompt information.

You can set the prompt position automatic processing + top + upper right corner + right + lower right corner + bottom + lower left corner + left + upper left corner.

You can set whether to check whether the data produces a different background color, for example, each column in a column chart can generate a different background color based on the data.

You can set whether to display the legend + the location of the legend + the number of rows of the legend and whether the legend is displayed on a single line.

Support multiple curves + column chart + column grouping chart + horizontal histogram + horizontal grouping chart + columnar stacking chart.

Built-in 15 sets of exquisite colors, automatically take the color of the color collection, save the trouble of color matching.

Each bar chart can be set to a different color, and a grouped bar chart can set alternating colors.

Y-axis values support percentage display and can be extended to other formats.

Both QCustomPlot 1.0 and QCustomPlot 2.0 are supported.

Second, the effect picture

Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Color columnar configurable curve support data graph background different position legend multiple interface horizontal grouping learning smoothing information content cross Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Technology Shulou Information OPPO Reno NVidia