TreeMap 컴포넌트 — sgcHTML | eSeGeCe

TreeMap

TsgcHTMLComponent_TreeMap — Delphi, C++ Builder 및 .NET에서 차트 라이브러리 없이, 서버에서 생성되는 독립형 인라인 SVG로 정방형화된 트리맵을 렌더링합니다.

TsgcHTMLComponent_TreeMap

레이블과 값을 가진 항목을 추가한(또는 데이터셋을 바인딩한) 다음, 색상 구성표를 선택하고, HTML 속성을 읽습니다.

컴포넌트 클래스

TsgcHTMLComponent_TreeMap

렌더링

독립형 인라인 SVG, 정방형화 레이아웃

언어

Delphi, C++ Builder, .NET

항목을 추가하고, 렌더링하기

사각형마다 AddItem을 호출하고, ColorScheme을 선택한 다음, HTML을 읽습니다. 레이아웃은 서버 측에서 계산되며 클라이언트 측 라이브러리가 필요하지 않습니다.

uses
  sgcHTML_Component_TreeMap;

var
  oTreeMap: TsgcHTMLComponent_TreeMap;
begin
  oTreeMap := TsgcHTMLComponent_TreeMap.Create(nil);
  try
    oTreeMap.Width := 640;
    oTreeMap.Height := 360;
    oTreeMap.ColorScheme := tmCool;
    oTreeMap.ShowValues := True;

    oTreeMap.AddItem('Engineering', 420000);
    oTreeMap.AddItem('Sales', 260000);
    oTreeMap.AddItem('Marketing', 140000);
    oTreeMap.AddItem('Support', 90000, '#20c997');   // explicit colour overrides the scheme

    WebModule.Response := oTreeMap.HTML;   // <svg> squarified rectangles, no client-side library
  finally
    oTreeMap.Free;
  end;
end;

// Or bind it straight to a dataset:
oTreeMap.LoadFromDataSet(qryBudget, 'Department', 'Amount');

// One-shot helper, no instance to manage:
Response := TsgcHTMLComponent_TreeMap.Build(['Engineering', 'Sales'], [420000, 260000]);
// includes: sgcHTML_Component_TreeMap.hpp

TsgcHTMLComponent_TreeMap *oTreeMap = new TsgcHTMLComponent_TreeMap(NULL);
try
{
  oTreeMap->Width = 640;
  oTreeMap->Height = 360;
  oTreeMap->ColorScheme = tmCool;
  oTreeMap->ShowValues = true;

  oTreeMap->AddItem("Engineering", 420000);
  oTreeMap->AddItem("Sales", 260000);
  oTreeMap->AddItem("Marketing", 140000);
  oTreeMap->AddItem("Support", 90000, "#20c997");   // explicit colour overrides the scheme

  String html = oTreeMap->HTML;   // <svg> squarified rectangles, no client-side library
}
__finally
{
  delete oTreeMap;
}
using esegece.sgcWebSockets;

var treeMap = new TsgcHTMLComponent_TreeMap();
treeMap.Width = 640;
treeMap.Height = 360;
treeMap.ColorScheme = TsgcHTMLTreeMapScheme.tmCool;
treeMap.ShowValues = true;

treeMap.AddItem("Engineering", 420000);
treeMap.AddItem("Sales", 260000);
treeMap.AddItem("Marketing", 140000);
treeMap.AddItem("Support", 90000, "#20c997");   // explicit colour overrides the scheme

string html = treeMap.HTML;   // <svg> squarified rectangles, no client-side library

// One-shot helper, no instance to manage:
string quick = TsgcHTMLComponent_TreeMap.Build(new[] { "Engineering", "Sales" }, new[] { 420000d, 260000d });

주요 속성 및 메서드

가장 자주 사용하게 되는 멤버.

항목 / AddItem

AddItem(aLabel, aValue, aColor)는 리프 사각형을 하나 추가합니다. 명시적인 aColor는 활성화된 ColorScheme보다 우선합니다.

계층 구조

Items는 2단계 트리맵을 지원합니다. 부모 및 자식 항목에 ID / ParentID를 설정하면 자식 사각형이 흐릿하게 표시된 부모 안에 중첩됩니다.

데이터셋 바인딩

LoadFromDataSet(aDataSet, aLabelField, aValueField)는 행마다 평면 항목을 하나씩 로드합니다.

일회성 헬퍼

클래스 함수 Build(aLabels, aValues)는 관리할 컴포넌트 인스턴스 없이 평면 트리맵을 곧바로 문자열로 렌더링합니다.

크기 및 팔레트

Width, Height, PaddingColorScheme(default/blue/green/warm/cool/gray)이 캔버스와 자동 지정되는 사각형 색상을 제어합니다.

레이블

ShowLabels, ShowValues, MinLabelSizeFontSize가 사각형 캡션이 그려지는 시점과 방식을 결정하며, HTML은 완성된 인라인 <svg>를 반환합니다.

계속 살펴보기

온라인 도움말이 찱포넌트의 전체 API 참조 및 사용 가이드입니다.
모든 sgcHTML 컴포넌트80개 이상의 컴포넌트 전체 기능 매트릭스를 둘러보십시오.
무료 체험판 다운로드30일 체험판에는 60.HTML 데모 프로젝트가 포함됩니다.
가격전체 소스 코드가 포함된 Single, Team 및 Site 라이선스.

시작할 준비가 되셨습니까?

무료 체험판을 다운로드하고 Delphi, C++ Builder 및 .NET에서 웹 UI를 구축하기 시작하십시오.