hecrus

Chart Polar Area

Oct 18th, 2020
560
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE PROCEDURE [dbo].[crud_tst-chart6_getItems]
  2.     @filters CRUDFilterParameter READONLY,  
  3.     @sort sql_variant,
  4.     @direction nvarchar(8),
  5.     @page int,
  6.     @pageSize int,
  7.     @username nvarchar(32)
  8. AS
  9. BEGIN
  10.     declare @result TABLE (title nvarchar(256), value int, color nvarchar(128))
  11. declare @langID int
  12.     select @langID = try_cast(Value as int) from @filters where [Key] = 'langID'
  13.  
  14.     insert into @result
  15.     select 'First company' title, 55 Value, 'pink' color
  16.     union
  17.     select 'Petrov PE' title, 40 Value, 'powderBlue' color
  18.     union
  19.     select 'Ivanov PE' title, 27 Value, 'lightGreen' color
  20.     union
  21.     select 'Condition Limited' title, 22 Value, 'aqua' color
  22.     union
  23.     select 'GorGarSnabStryServiceBit' title, 18 Value, 'lightGrey' color
  24.    
  25.     -- 1 SELECT - сами данные    
  26.     select * from @result
  27.  
  28.     -- 2 SELECT - кол-во в таблице
  29.     select count(*) from @result   
  30.  
  31.     -- 3 SELECT Дополнительные настройки таблицы
  32.     select 'chart' ViewType, 'polarArea' ChartType, iif(@langID=1, 'By order count', 'По количеству заказов') ChartTitle, 0 ChartWidth, 0 ChartHeight, 1 HidetitleCount,
  33.         iif(@langID=1, 'TOP 5 Active customers (2)', 'Топ 5 наиболее активных заказчиков (2)') Title
  34.    
  35. END
  36.  
RAW Paste Data