Fanruan BI development-Day2-various deformations of trend charts

Foreword:

        In BI data display, bar charts and trend charts are undoubtedly two types of graphics that are used in many scenarios. Different from bar charts, trend charts can better reflect certain objective laws and future trends, so they are used as business scenarios for early warning and judgment. However, trend charts in actual business scenarios are not as simple as you think. , today let’s discuss how to implement complex trend charts on Fanruan.

1. Self-introduction-trend chart

        1.Introduce yourself

        The Fanruan trend chart is a data visualization chart based on trend analysis, which shows the trend of data changes over a period of time . This chart is commonly used in analysis of stocks, commodities, technology, and the economy.

        FanRuan trend charts usually consist of a Y-axis and an X-axis. The Y-axis represents changes in data, and the X-axis represents time trends. By connecting data points, you can clearly see the changes in trends, including upward trends, downward trends, and oscillatory trends .

You can also add multiple lines         to the Fanruan trend chart to show comparisons between different data. For example, in stock analysis, we can display the price trends of several stocks at the same time to better compare their performance.

Fanruan trend charts are widely used in data analysis and decision-making. It can help us better understand the changing trends of data and formulate decision-making plans         more accurately .

        2. Application examples

        2.1 Eight major differences

         2.2CTP analysis

        

        2.3 CTQ analysis

 2. Implementation instructions

        As shown in the actual application case above, the trend chart we display is not just a curve. For example, in the eight major differences, there are different colors, graphics, etc. on a curve to indicate the corresponding points or continuous trends that have warnings or abnormalities. In CTP, we can select any number of curves for comparative analysis. In CTQ, we can also use the standard upper and lower limits, the median, and the Six Sigma line as reference lines to see which interval the corresponding trend point falls in, and combine the eight major differences to dynamically display the early warning judgment points and trends corresponding to the needs to meet complex needs. need.

        In order to let us better understand the trend chart, we split the trend chart into two major categories, and classification-X axis, series-Y axis, to explain in detail the underlying implementation logic.

        1. Classification-X axis

       Classification is the X-axis of the trend chart. It is usually data similar to time, but sometimes it can also be batches, because sometimes the business needs to see the data changes of several consecutive batches, etc. Of course, it can also be everything, so classification -X axis, we can choose any dimension that needs to be analyzed. The only thing that needs to be noted is that we need to ensure uniqueness in the same trend chart. We keep the data unified, and the same classification values ​​will be summed by default. Similar to sum(categorization) group by classification.

        As shown in the figure above, by default, values ​​D0/USL/LSL with the same classification SM will be summed. 

         2. Series-Y axis

        Series are dimensional values ​​displayed by category, such as D0/USL/LSL as shown above. The series can be 1 or more. In order to show a better series trend effect, the maximum value, minimum value and trend are generally set. Line, the purpose of setting the maximum and minimum values ​​is to make the corresponding graphics appear as centered as possible. It is worth noting that in order to make the graphics look good, the maximum value of the series should be set to the maximum value in all series * 1.02, and the minimum value should be set to the smallest value in the series . Value*0.98 . To obtain the maximum value of multiple fields, you can use the greatest function. To obtain the minimum value of multiple fields, you can use the least function. For a detailed introduction to the series, click the link below.

       Chart Series - FineReport Help Document - Comprehensive report usage tutorials and learning materials

    3. Special cases

        Here are some special trend cases.

        1. Multiple trend charts, the number of trend charts changes according to user selection

        As shown in the figure above, when the user selects 3 batches of data, 3 different trends will be displayed. How is this achieved?

        As shown in the figure above, select " Field Value " and the series name is what the user selects, which is equivalent to grouping according to the number of series names selected by the user. When 3 different series names are selected, 3 trend charts will be generated. . There are two grouping dimensions at this time , one is "category" and the other is "series name", similar to select fywd from t group by category, series name .

        2. Fixed multiple trend charts to display multiple series of data

        As shown in the figure above, we show the reaction temperature and the data change trends of multiple different batches. What if you want to show the trend changes of different projects in the same batch? For example, display the trend changes of multiple items in the same batch of D0/D5/D10/D50/D90/D95/D100.

        As shown in the figure above, we show the trend changes of multiple projects in the same batch. So how is this achieved?

        As shown in the figure above, we choose the form of " field name ". At this time, there will only be one group maintenance, that is, classification. The corresponding series name is customized and can be flexibly customized according to needs.

     4. Trend line + multiple Y-axis

        1. Trend line

        One thing to mention is that in order to assist in viewing trend charts and predicting future trends, we can generate trend lines to view trend changes in trend charts. Corresponding to the trend line settings, linear fitting is generally selected to predict changes in observations and trend graphs. The specific settings are as shown in the figure below.

        2. Multiple Y-axis

        As mentioned above, when we look at the trend changes of different projects in the same batch, in order to keep the values ​​of all projects as centered as possible, we will use the form of multiple Y-axes so that the projects do not affect each other. The specific operation is to stack the coordinate axis. Distinguish the corresponding meaning of each Y axis by setting multiple Y axes and naming multiple Y axes. The specific operation is as shown in the figure below.

        It is worth mentioning that the official documentation states that only custom charts can have this function. After actual testing, any chart has this function, as long as the corresponding stacked coordinate axis is configured. It should be noted that the default first Y axis does not need to set the stacked coordinate axis. The other stacked coordinate axes can be matched one-to-one as required.

 

Guess you like

Origin blog.csdn.net/qq_29061315/article/details/132557898