Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the Migration Graph with Qt

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article focuses on "how to use Qt to achieve migration map", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use Qt to achieve the migration map.

I. Preface

In many web systems, especially in large screen systems, we can often see the effect similar to the aircraft migration chart, which is also the most commonly used effect in echart. The migration chart can be either an aircraft or other shapes, and then there is a dynamic moving trajectory to represent the flow direction. Generally, multiple points flow to one point, or one point flows to multiple points, which is a many-to-many relationship. It is often used to indicate population migration, animal migration, hacker attacks, virus attacks, data flow, product flow and so on.

Similar to the flicker map in the previous article, the migration map also needs to provide three basic elements: the city name set, the city latitude and longitude set, and the central city longitude and latitude. The color of the city point and the color of the migration direction arrow can be set separately. Echart makes every effort to provide a variety of attributes for each class object, as long as you can imagine. It is estimated that developers are constantly improving and refining from the actual requirements, such as color, position, action, animation, font, size, shape, effect, type, etc., which still admire the relevant developers very much. it is indeed quite perfect to be able to constantly improve and upgrade to today.

II. Functional features

At the same time, support flicker point map, migration map, area map, dashboard and so on.

You can set various colors such as title, prompt, background color, text color, line color, area color, and so on.

You can set the name, value, longitude and latitude collection of the city.

You can set the magnification of the map and whether the mouse wheel is allowed to zoom.

Built-in world map, national map, provincial map, regional map, can be accurate to the county, all maps are used offline.

Built-in provincial and municipal json data file to js file function, if there is a data update self-conversion, support a single file conversion and one-click conversion of all files.

Built-in function to obtain all the names and longitude and latitude information sets of the region from json files or js files, which can be used to display the information obtained by this method.

Depending on the browser component to display the map, the provided demo supports webkit, webengine and ie to load web pages.

Strong expansibility, you can add a variety of exquisite echarts components according to the gourd painting ladle to make a great effect.

The built-in dashboard components provide interactive functionality, and the corresponding code is included in the demo demo.

The function interface is friendly and unified, and it is easy to use, just one class.

Support any Qt version, any system, any compiler.

Third, effect picture

4. Related code / / Core code QString Echarts::newChartMove (const QString & centerCity) {int cityNameCount = cityName.count (); int cityValueCount = cityValue.count (); int cityPointCount = cityPoint.count (); if (cityNameCount! = cityValueCount | | cityValueCount! = cityPointCount) {return ";} QStringList body; / / add the corresponding value QStringList values For (int I = 0; I < cityNameCount; iTunes +) {values

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report