728x90

cheekyxy commented on 5 Oct 2017  

  • Version: "1.10"
  • Device: Windows 10
  • Browser: Google chrome

Scenario : Suppose I selected 1 month timeframe and then I want candlesticks accoding to 5min or 15min or any other time I select .
Lets say I have selected 1 day timeframe and then I select 4H candlestick option.So the chart should display 24/4 = 6 candle sticks .
So I want to know that how it can be done ?
I have attached a screenshot for example.
chart

@timocov

timocov commented on 5 Oct 2017

Hi,

  1. You can use setVisbibleRange method https://github.com/tradingview/charting_library/wiki/Chart-Methods#setvisiblerangerange-callback
  2. You can wait until we implements #2060
@cheekyxy

cheekyxy commented on 5 Oct 2017  

@timocov I to want implement the things as below:

  • First select the timeframe
    -Then the candle sticks should be shown according to Candlesticks option as shown in screenshots below:
    1 .
    chart1

chart2

@timocov

timocov commented on 5 Oct 2017

Yeah, I get it and my answer is exactly about it.

@timocov

timocov commented on 10 Oct 2017

  1. Where you call setVisibleRange? I saw it only for timeframe=='12m' in your code.
  2. Your datafeed does not support 3min resolution.
@cheekyxy

cheekyxy commented on 10 Oct 2017  

@timocov
Leave setVisibleRange for now but what should I do to support my datafeed of 1min,3min,5min ?
Please help me with that !

@cheekyxy

cheekyxy commented on 10 Oct 2017

@timocov @ezhukovskiy
After updating supported resolutions in my datafeed the resolutions are still disabled as shown in screenshot :
min_chart1

@timocov

timocov commented on 10 Oct 2017

Because your symbol does not support this resolutions. See https://github.com/tradingview/charting_library/wiki/Symbology#supported_resolutions

@cheekyxy

cheekyxy commented on 10 Oct 2017

@timocov
What should I do make it support ? Because I have commented the code for symbols search in datafeed . I just want to make it supportable.

@timocov

timocov commented on 10 Oct 2017

In symbol info you should specify which resolutions symbol supports. Please read article https://github.com/tradingview/charting_library/wiki/Symbology

@cheekyxy

cheekyxy commented on 11 Oct 2017

@timocov
Thanks a lot . Your symbolinfo suggestion worked.

@cheekyxy

cheekyxy commented on 11 Oct 2017

@timocov
I don't want to show highlighted part in my chart as shown in screenshot below . Would you help me with this ?

Screenshot : https://www.screencast.com/t/ZMp6wlEp

@cheekyxy

cheekyxy commented on 13 Oct 2017

@timocov @ezhukovskiy

Is it possible to change the data for chart when time interval is changed ?

@timocov

timocov commented on 13 Oct 2017

When interval changed the library will rerequest the data. What do you mean?

@cheekyxy

cheekyxy commented on 13 Oct 2017  

@timocov

I mean I have to change the data totally. I have to request data from another URL.

@timocov

timocov commented on 13 Oct 2017

Sorry, but it is not issue anymore.

@timocov timocov closed this on 13 Oct 2017


'WEB' 카테고리의 다른 글

MySQL 시퀀스 생성하기  (0) 2018.02.14
[PHP]자식창에서 부모창 새로고침해서 부모창에 세션결과 표시하기  (0) 2018.02.09
[PHP] Parsing  (0) 2018.02.05
[PHP] number with comma  (0) 2018.02.05
[Google Chart] Candle Stick  (0) 2018.01.30
728x90


데이터의 다음 행을 숫자로 인덱싱된 배열, 결합형 배열 또는 둘 다로 검색합니다.

구문


sqlsrv_fetch_array( resource $stmt[, int $fetchType [, row[, ]offset]])  

매개 변수

$stmt: 실행된 문에 해당하는 문 리소스입니다.

$fetchType [선택 사항]: 미리 정의 된 상수입니다. 이 매개 변수는 다음 표에 나열된 값 중 하나를 사용할 수 있습니다.

Description
SQLSRV_FETCH_NUMERIC데이터의 다음 행이 숫자형 배열로 반환됩니다.
SQLSRV_FETCH_ASSOC데이터의 다음 행이 결합형 배열로 반환됩니다. 배열 키는 결과 집합의 열 이름입니다.
SQLSRV_FETCH_BOTH데이터의 다음 행이 숫자형 배열과 결합형 배열 둘 다로 반환됩니다. 이 값은 기본값입니다.

 [선택 사항]: 버전 1.1에에서 추가 합니다. 다음 값 중 하나로 스크롤 가능 커서를 사용하는 결과 집합에서 액세스할 행을 지정합니다. (때  지정 된 fetchtype 명시적으로 지정 해야 기본값을 지정 하는 경우에 합니다.)

  • SQLSRV_SCROLL_NEXT
  • SQLSRV_SCROLL_PRIOR
  • SQLSRV_SCROLL_FIRST
  • SQLSRV_SCROLL_LAST
  • SQLSRV_SCROLL_ABSOLUTE
  • SQLSRV_SCROLL_RELATIVE

이러한 값에 대한 자세한 내용은 커서 유형 지정 및 행 선택을 참조하세요. 스크롤 가능 커서 지원이 Microsoft Drivers for PHP for SQL Server의 버전 1.1에 추가되었습니다.

오프셋 [선택 사항]: 검색할 행을 지정 하려면 데 SQLSRV_SCROLL_ABSOLUTE 및 SQLSRV_SCROLL_RELATIVE 함께 사용 합니다. 결과 집합의 첫 번째 레코드는 0입니다.

반환 값

데이터 행이 검색되는 경우 배열 이 반환됩니다. 검색할 행이 더 이상 없는 경우 null 이 반환됩니다. 오류가 발생하면 false 가 반환됩니다.

$fetchType 매개 변수의 값을 기반으로, 반환된 배열 은 숫자로 인덱싱된 배열, 결합형 배열또는 둘 다일 수 있습니다. 기본적으로 숫자 키와 결합형 키가 둘 다 있는 배열 이 반환됩니다. 반환된 배열에 있는 값의 데이터 형식은 기본 PHP 데이터 형식입니다. 기본 PHP 데이터 형식에 대한 자세한 내용은 Default PHP Data Types을 참조하세요.

주의

이름이 없는 열이 반환되면 배열 요소에 대한 결합형 키는 빈 문자열("")입니다. 예를 들어 값을 데이터베이스 테이블에 삽입하고 서버 생성 기본 키를 검색하는 다음 Transact-SQL 문을 고려해 보겠습니다.

INSERT INTO Production.ProductPhoto (LargePhoto) VALUES (?);  
SELECT SCOPE_IDENTITY()

반환 된 결과 집합이 SELECT SCOPE_IDENTITY() 이 문의 부분 결합형 배열로 검색 되 인 반환된 된 값에 대 한 키는 빈 문자열 ("")는 반환 된 열에 이름이 없기 때문에 합니다. 이를 방지하려면 결과를 숫자형 배열로 검색하거나 Transact-SQL 문에서 반환된 열에 대한 이름을 지정할 수 있습니다. 다음은 Transact-SQL에 열 이름을 지정하는 한 가지 방법입니다.

SELECT SCOPE_IDENTITY() AS PictureID

결과 집합에 이름이 없는 여러 열이 포함된 경우 마지막으로 이름이 지정되지 않은 열의 값이 빈 문자열("") 키에 할당됩니다.

예제

다음 예제는 결과 집합의 각 행을 결합형 배열로 검색합니다. 이 예제에서는 SQL Server 및 AdventureWorks 데이터베이스가 로컬 컴퓨터에 설치된 것으로 가정합니다. 모든 출력은 명령줄에서 예제가 실행될 때 콘솔에 기록됩니다.

<?php  
/* Connect to the local server using Windows Authentication and  
specify the AdventureWorks database as the database in use. */  
$serverName = "(local)";  
$connectionInfo = array( "Database"=>"AdventureWorks");  
$conn = sqlsrv_connect( $serverName, $connectionInfo);  
if( $conn === false )  
{  
     echo "Could not connect.\n";  
     die( print_r( sqlsrv_errors(), true));  
}  

/* Set up and execute the query. */  
$tsql = "SELECT FirstName, LastName  
         FROM Person.Contact  
         WHERE LastName='Alan'";  
$stmt = sqlsrv_query( $conn, $tsql);  
if( $stmt === false)  
{  
     echo "Error in query preparation/execution.\n";  
     die( print_r( sqlsrv_errors(), true));  
}  

/* Retrieve each row as an associative array and display the results.*/  
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC))  
{  
      echo $row['LastName'].", ".$row['FirstName']."\n";  
}  

/* Free statement and connection resources. */  
sqlsrv_free_stmt( $stmt);  
sqlsrv_close( $conn);  
?>  

예제

다음 예제는 결과 집합의 각 행을 숫자로 인덱싱된 배열로 검색합니다.

제품 정보를 검색 하는 예제는 Purchasing.PurchaseOrderDetail 지정된 된 날짜와 재고량이 있는 제품에 대 한 AdventureWorks 데이터베이스의 테이블 (StockQty) 지정된 된 값 보다 작습니다.

이 예제에서는 SQL Server 및 AdventureWorks 데이터베이스가 로컬 컴퓨터에 설치된 것으로 가정합니다. 모든 출력은 명령줄에서 예제가 실행될 때 콘솔에 기록됩니다.

<?php  
/* Connect to the local server using Windows Authentication and  
specify the AdventureWorks database as the database in use. */  
$serverName = "(local)";  
$connectionInfo = array( "Database"=>"AdventureWorks");  
$conn = sqlsrv_connect( $serverName, $connectionInfo);  
if( $conn === false )  
{  
     echo "Could not connect.\n";  
     die( print_r( sqlsrv_errors(), true));  
}  

/* Define the query. */  
$tsql = "SELECT ProductID,  
                UnitPrice,  
                StockedQty   
         FROM Purchasing.PurchaseOrderDetail  
         WHERE StockedQty < 3   
         AND DueDate='2002-01-29'";  

/* Execute the query. */  
$stmt = sqlsrv_query( $conn, $tsql);  
if ( $stmt )  
{  
     echo "Statement executed.\n";  
}   
else   
{  
     echo "Error in statement execution.\n";  
     die( print_r( sqlsrv_errors(), true));  
}  

/* Iterate through the result set printing a row of data upon each  
iteration.*/  
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_NUMERIC))  
{  
     echo "ProdID: ".$row[0]."\n";  
     echo "UnitPrice: ".$row[1]."\n";  
     echo "StockedQty: ".$row[2]."\n";  
     echo "-----------------\n";  
}  

/* Free statement and connection resources. */  
sqlsrv_free_stmt( $stmt);  
sqlsrv_close( $conn);  
?>  

sqlsrv_fetch_array 함수에 따라 데이터는 항상 반환 된 기본 PHP 데이터 형식합니다. PHP 데이터 형식을 지정하는 방법에 대한 자세한 내용은 How to: Specify PHP Data Types을 참조하세요.

이름이 없는 필드가 검색되는 경우 배열 요소에 대한 결합형 키는 빈 문자열("")입니다. 자세한 내용은 sqlsrv_fetch_array를 참조하세요.

참고 항목

SQLSRV 드라이버 API 참조
데이터 검색
설명서의 코드 예제 정보
PHP SQL 드라이버 프로그래밍 가이드

'DB' 카테고리의 다른 글

PATH=$PATH:/usr/local/mysql/bin;  (0) 2018.04.19
SQL Database Performance Tuning for Developers  (0) 2018.04.10
[MSSQL]sqlsrv_execute  (0) 2018.02.05
jQuery mouseleave()  (0) 2018.01.14
mysqli_result::fetch_array  (0) 2018.01.14
728x90

(No version information available, might only be in Git)

sqlsrv_execute — Executes a statement prepared with sqlsrv_prepare()

Description ¶

bool sqlsrv_execute ( resource $stmt )

Executes a statement prepared with sqlsrv_prepare(). This function is ideal for executing a prepared statement multiple times with different parameter values.

Parameters ¶

stmt

A statement resource returned by sqlsrv_prepare().

Return Values ¶

Returns TRUE on success or FALSE on failure.

Examples ¶

Example #1 sqlsrv_execute() example

This example demonstrates how to prepare a statement with sqlsrv_prepare() and re-execute it multiple times (with different parameter values) using sqlsrv_execute().

<?php
$serverName 
"serverName\sqlexpress";
$connectionInfo = array( "Database"=>"dbName""UID"=>"username""PWD"=>"password");
$conn sqlsrv_connect$serverName$connectionInfo);
if( 
$conn === false) {
    die( 
print_rsqlsrv_errors(), true));
}

$sql "UPDATE Table_1
        SET OrderQty = ?
        WHERE SalesOrderID = ?"
;

// Initialize parameters and prepare the statement. 
// Variables $qty and $id are bound to the statement, $stmt.
$qty 0$id 0;
$stmt sqlsrv_prepare$conn$sql, array( &$qty, &$id));
if( !
$stmt ) {
    die( 
print_rsqlsrv_errors(), true));
}

// Set up the SalesOrderDetailID and OrderQty information. 
// This array maps the order ID to order quantity in key=>value pairs.
$orders = array( 1=>102=>203=>30);

// Execute the statement for each order.
foreach( $orders as $id => $qty) {
    
// Because $id and $qty are bound to $stmt1, their updated
    // values are used with each execution of the statement. 
    
if( sqlsrv_execute$stmt ) === false ) {
          die( 
print_rsqlsrv_errors(), true));
    }
}
?>

Notes ¶

When you prepare a statement that uses variables as parameters, the variables are bound to the statement. This means that if you update the values of the variables, the next time you execute the statement it will run with updated parameter values. For statements that you plan to execute only once, use sqlsrv_query().

See Also ¶

add a note add a note

User Contributed Notes 2 notes

tuxedobob ¶
1 year ago
If you're used to working with sqlsrv_query, you're probably used to the following flow:

<?php
$query 
"SELECT * FROM mytable WHERE id=?";
$result sqlsrv_query($conn$query, array($myID));
$row sqlsrv_fetch_array($result);
?>

Given that, you might think the following works:

<?php
$myID 
0;
$query "SELECT * FROM mytable WHERE id=?";
$stmt sqlsrv_prepare($conn$query, array(&$myID));
$result sqlsrv_execute($stmt);
$row sqlsrv_fetch_array($result);
?>

It doesn't. The reason is that sqlsrv_execute, as noted above, returns true or false on success or failure, respectively. The variable that has your result is actually $stmt. Change the last row to 

<?php
$row 
sqlsrv_fetch_array($stmt);
?>

and it works as expected.
vavra at 602 dot cz ¶
19 days ago
Attention!
If the sql contains INSERT, UPDATE or DELETE statements, the number of affected rows must be consumed. The sqlsrv_query returns a sql cursor that must be read to finish the transaction, if the result is non false. This same is valid for sqlsrv_execute. In this case the cursor must be also read using the prepared statement handle $smt.

Another solution is to place SET NOCOUNT ON at the top of the sqlsrv statement and all called procedures, functions and triggers.

We've practically observed it with sql statement with 500 inserts but only 368 was inserted without false returned. Prefixing by SET NOCOUNT ON or reading a cursor all rows were inserted.

See Processing Results (ODBC): https://docs.microsoft.com/en-us/sql/relational-databases/native-client-odbc-results/processing-results-odbc Each INSERT, UPDATE, and DELETE statement returns a result set containing only the number of rows affected by the modification. This count is made available when application calls SQLRowCount. ODBC 3.x applications must either call SQLRowCount to retrieve the result set or SQLMoreResults to cancel it. When an application executes a batch or stored procedure containing multiple INSERT, UPDATE, or DELETE statements, the result set from each modification statement must be processed using SQLRowCount or cancelled using SQLMoreResults. These counts can be cancelled by including a SET NOCOUNT ON statement in the batch or stored procedure.


'DB' 카테고리의 다른 글

SQL Database Performance Tuning for Developers  (0) 2018.04.10
[MSSQL]sqlsrv_fetch_array  (0) 2018.02.05
jQuery mouseleave()  (0) 2018.01.14
mysqli_result::fetch_array  (0) 2018.01.14
mysqli::query  (0) 2018.01.14
728x90

The text-justify property in CSS is a companion to the text-align property that is used to set the justification method of text when text-align is set to the justify value.

p {
  text-align: justify;
  text-justify: inter-word;
}

#Values

  • inter-word: Specifies that text is justified by adjusting the spacing between words, effectively creating additional word spacing. This is effectively a variation of the word-spacingproperty.
  • inter-character: Specifies that text is justfiied by adjusting the spacing between characters, effectively creating additional character spacing. This is effectively a variation of the letter-spacing property.
  • auto: Allows the browser to determine whether justification is better handled as inter-word or inter-character. This can be helpful in multi-lingual scenarios where the content language is unknown until rendered, allowing the browser user agent to choose accordingly based on which method better fits the language context.
  • none: Disables justification methods, effectively removing any justification opportunities, or overriding where a justification method may occur in the cascade.

#What exactly is justification?

Justified text is a fancy way of saying how text fills the box that contains it. In fact, you may already be well acquainted with justifying text and don't even know it. If you have ever used text editing software like Word and Google Docs, then you might be familiar with these icons:

Text align and justification options in the Google Docs toolbar

Those first three set the text alignment, just like the CSS text-alignproperty, where the text can be aligned to the left, right or completely centered.

That fourth icon is the justify option and it tells the content to fill the entire width of the document so that each line is flush right to the edge, regardless of whether it affects the spacing between words.

Justifying content in Google Docs adds spacing between words to occupy the full document width at each line

The text-justify property allows us to do the same, but with additional flexibility to determine whether the spacing method used to justify the content is managed between words or characters.

#Browser Support

The text-justify property is included in the CSS Text Module Level 3 specification, which is currently in Editor's Draft status at the time of this writing.

This property is currently listed as "at risk" of being dropped in the Candidate Recommendation period. As such, it is not recommended to use this property in production as it is unlikely to be adopted as a standard across all browsers in the near future.

Current support is limited to Firefox 55+. Internet Explorer 11 and Edge 14+ also support the property, but only the inter-word value as well as unofficial values not included in the W3C specification.

This browser support data is from Caniuse, which has more detail. A number indicates that browser supports the feature at that version and up.

#Desktop

ChromeOperaFirefoxIEEdgeSafari
NoNo551117No

#Mobile / Tablet

iOS SafariOpera MobileOpera MiniAndroidAndroid ChromeAndroid Firefox
NoNoNoNoNo57


'WEB > CSS' 카테고리의 다른 글

Box Shadow II  (0) 2018.06.07
Box-Shadow  (0) 2018.06.07
HTML5 number inputs – Comma and period as decimal marks  (0) 2018.01.24
Select box dir  (0) 2018.01.24
[CSS] Vertical Align  (0) 2018.01.24

+ Recent posts