Git Product home page Git Product logo

qt_zoomable_chart_widget's Introduction

Zoomable chart widget for Qt

Wrapper widget around QChartView which provides basic zoom/pan/legend handling stuff

Why?

Because I got rid of configuring the QtCharts widget in each of my applications

How to use it?

Add this project to your Qt application as a submodule with:

git submodule add https://github.com/martonmiklos/qt_zoomable_chart_widget.git

Include it into your project by adding the follwing to your .pro file:

include(qt_zoomable_chart_widget/zoomable_chart_widget.pri)

Create you UI with QtDesigner (or Designer plugin in the QtCreator). Add your chart as a QWidget and then promote to the ZoomableChartWidget:

Promoting widget

You can access the underlying QtChart object via

ui->whateverIsMyWidgetName->chart()

You can add/remove series,axes do whatever else you do with a QtChart.

Features

Zoom mode

There is a zoom mode selector combobox above the chart. I know this is a space wasting thing, I am planning to move this feature to a hamburger style button to the graph area's corner.

Zoom mode selector

You can select 4 zoom modes with it:

  • pan icon Pan mode: you can drag the graph content with pressed mouse button along the horizontal axes. If you press the Ctrl key you can do panning along the vertical axes.
  • rectangular icon Rectangular zoom mode
  • horizontal icon You can zoom into the graph contents on the horizontal axis with the mouse wheel. If you press the Ctrl key the zoom will be performed on the vertical axis.
  • vertical icon You can zoom into the graph contents on the vertical axis with the mouse wheel. If you press the Ctrl key the zoom will be performed on the horizontal axis.

Legend show/hide

You can show/hide series by clicking on the Legend markers. Inspired by the Legend markers Qt example)

Legend hover highlight

When hovering the mouse over the legend markers the respective series line width will be doubled: Legend hover

Limiting scrolling/zooming of QValueAxis

You can limit the scroll/zooming ranges of QValueAxes by using RangeLimitedValueAxis.

If you find this feature useful to be included in the Qt itself please comment/vote on this issue.

qt_zoomable_chart_widget's People

Contributors

martonmiklos avatar shujaatak avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.